Skip to content
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

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

dbauszus-glx
Copy link
Member

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.

@dbauszus-glx dbauszus-glx added Code Issues related to the code structure and performance. Documentation Adding or updating documentation. labels Jul 11, 2024
@dbauszus-glx dbauszus-glx self-assigned this Jul 11, 2024
@dbauszus-glx dbauszus-glx linked an issue Jul 11, 2024 that may be closed by this pull request
Copy link
Contributor

@AlexanderGeere AlexanderGeere left a 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.

@dbauszus-glx
Copy link
Member Author

@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"
          },

image

Copy link
Contributor

@RobAndrewHurst RobAndrewHurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

Copy link
Contributor

@simon-leech simon-leech left a 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

@simon-leech simon-leech merged commit f8314cd into GEOLYTIX:main Jul 12, 2024
4 checks passed
@dbauszus-glx dbauszus-glx deleted the entry-default-defaults branch September 9, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Issues related to the code structure and performance. Documentation Adding or updating documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

entry.default and entry.defaults for type:defaults
4 participants