Create a new field from type calendar and set in a default value, which is not possible. For example: mydefault
The not possible default value should be ignored or I should see an error message
The field is saved. But if i open an article for editing, the view is broken.
Labels |
Added:
?
|
The formfields that are used here don't check the validity of a default value. The code just assumes that the person who set the value knew what he did. Until now, that was the extension developer who set the default value. Now an admin can do the same.
Imho, it is up to the administrator to make sure the default values work.
Most fields will not break with a wrong default value
-- if a field should validate the default value, it is a thing of every field atomically,
It could be added to form field creation and show a warning
-- thus configuration can be fixed
It should never be added when the field values are viewed / rendered
Most fields will not break with a wrong default value
-- if a field should validate the default value, it is a thing of every field atomically,
Actually the calendar (the js part) will default to today if the specified value is bad AFAIK
Maybe the com_fields is not utilising the new calendar yet?
Imho, it is up to the administrator to make sure the default values work.
Yes, for me it is no problem. And I am very happy with the custom fields like this.
But I think there are many administrators who do not know the syntax. And Joomla! has the problem that people say it is not user friendly.
That is why I opened this issue.
A wrong default value in calendar likely produces an error on server side already, way before JS got a chance to fix it :)
Title |
|
Title |
|
@Bakual yup, here is an example: http://codepen.io/dgt41/pen/BQEgvp
@laoneo you can discard my previous comment, fields are extending Joomla fields so...
Issue stay on latest 3.7-staging, wrong default Value breaks View.
Category | ⇒ | com_fields |
Status | New | ⇒ | Confirmed |
Title |
|
@Bakual can we do something similar to http://codepen.io/dgt41/pen/BQEgvp in the php part of the date?
If value is bad => value = now ??
Either "now" or "empty value" would work for me, I don't care. Is it only on JS side where it breaks currently?
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-01 12:53:46 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/13340
@astridx what's the browser's console error here?
BTW text is not acceptable for the calendar, the value needs to adhere to the given format, e.g. for
%Y-%m-%d
an acceptable value could be2016-01-01