-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review and document entry.default, entry.nullValue, and defaults. #1369
Review and document entry.default, entry.nullValue, and defaults. #1369
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifying a nullValue
on an editable field, incorrectly puts the value in the field.
tested on bugs_testing/plugins/userDatetime_worskpace.json
.
@AlexanderGeere I cannot reproduce this. When I create a new location which is editable the site_name is editable and empty. {
"title": "Site Name",
"field": "site_name",
"inline": true,
"edit": true,
"nullValue": "N/A"
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good with me too
The
defaults
entry method has been deprecated as this does only a subset of the functionality provided the userDatetime plugin.This is to prevent duplicate code. The plugin code is more advanced and can be maintained outside the core easing testing of the core code.
The entryDefault and entryNullValue methods have been reviewed and documented.
The core difference being that defaults should only apply to an editable entry providing the default as new value if the entry value is undefined.
The nullValue will only be assigned to non editable entries if the entry.value is undefined.