Add an option to InputfieldPage that allows new pages to be created regardless of duplicate titles #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Someone in the forums seems to have a requirement to consistently create new pages from InputfieldPage. To my surprise, this isn’t what the field actually does. This PR adds the option
forceCreate
to make the field behave the way I’ve always interpreteted its descriptions. It also amends the description in the page editor to clearly state that it will prefer existing pages.https://processwire.com/talk/topic/30187-auto-numbering-and-increment-value-of-the-field-of-new-child-pages-in-context-of-parent-page-reference-field/
I would have preferred to call the setting something like “prefer existing”, but I had to flip the logic to keep the old behaviour the default for backwards compatibility (checkboxes defaulting to checked are problematic because they don’t get sent when unchecked).
Thanks!