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

Categories: Forms: Change 'Default' value from -1 to 0 #742

Merged
merged 10 commits into from
Nov 25, 2024

Conversation

n7studios
Copy link
Contributor

Summary

When defining the Form setting on Pages or Posts, key/value pairs have always been:

Value Setting Label
-1 Default (i.e. inherit from Plugin Settings)
0 None (i.e. don't display a Form)
Form ID (integer) Form Names (i.e. display the specified Form)

When defining the Form setting on a Category, key/value pairs were:

Value Setting Label
default None
Form ID (integer) Form Names (i.e. display the specified Form)

The 'None' label was misleading, because selecting this choice would display the Form specified at Post or Plugin level. This PR changed the Form setting value and its label on a Category to better reflect this:

Value Setting Label
0 Default (i.e. inherit from Post Settings)
Form ID (integer) Form Names (i.e. display the specified Form)

However, this still isn't in line with Form settings on Pages and Posts, where Default is -1.

This PR resolves by matching the Category Form settings with the Post Form settings:

Value Setting Label
-1 Default (i.e. inherit from Post Settings)
Form ID (integer) Form Names (i.e. display the specified Form)

Automatic upgrade routines are included to change existing Category settings to reflect this underlying change.

Testing

  • testCategoryDefaultSettingsMigratedToNewValueOnUpgrade: Test that Category Form Settings = Default have their underlying value changed from 0 to -1

Checklist

@n7studios n7studios self-assigned this Nov 20, 2024
@n7studios n7studios requested review from a team, noelherrick and corydhmiller and removed request for a team November 21, 2024 02:35
@n7studios n7studios marked this pull request as ready for review November 21, 2024 02:36
Categories: Forms: Add `None` Option
@n7studios n7studios merged commit af0cbdc into main Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants