-
Notifications
You must be signed in to change notification settings - Fork 12
Validation #31
Validation #31
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.
Thanks for adding more to the PR description! I've added some preliminary feedback.
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.
I am going to completely honest here, some of the validation here, might be overkill or repeated. I think maybe some of it needs scaled back.
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.
I concur with @TimothyBJacobs' notes on cleaning up some of the validation, and presenting data in the format we'd want to work with it rather than in whatever legacy manner core stores values.
I noted some areas where I found the comments or formatting a bit confusing but these are not blockers for merge.
@kadamwhite All your feedback as been actioned. |
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.
Hey @spacedmonkey this is great! It's a big-ish PR I'd say.
Should all the new things in prepare_item_for_database
be covered by new tests?
Left minor comments and also noting that tests fail apparently only because of small style violations.
I have tested and indeed it also fixes #38 . |
I know this PR is a got a little to large. It got a little out of hand. To stop it getting any bigger and become impossible to review, I have agree with the rest of the team to just get this merged and work on another PR with test. Hopefully this will make the code review process quicker and mean we don't get blocked like this again. |
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.
Given that the remaining issues can be addressed in separate smaller PRs and that this PR works well I think we can merge this and be able to test working with menus via the api in the master of this plugin.
Going ahead and merging this. I'd really like to see tests for handling the negative menu item IDs and reordering. |
Improved validation of saving and displaying fields. Now correct types are checks and fields sanitized.
Much of this code is copied from wp-cli. See this.
There is more sanitize found in the customizer here.
Also improved all interger values defaults and allowed values.
This PR validation against the following use cases.
Other changes.
Fixes #38