Move settings definition on contribution settings form to metadata. #16513
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.
Overview
This moves the code that allows settings to be added to forms by metadata from the Generic setting form to the setting trait.
This means many more forms will support injecting settings by metadata. Specifically we switch across the Contribution preferences form,
making credit_note_prefix a metadata-added field. This is preliminary to moving that to an extension & allows us to inject it
in by simply defining the metadata in a hook
Before
Hard coded settings on form
After
Setting spec for adding settings to form used & respected
Technical Details
Pre the setting spec the preferred way to add a setting to a setting page is through metadata
-ie
'settings_pages' => ['contribute' => ['weight' => 80]],
Note that some pages are fully converted to the extent there is no actual php class for them - this doesn't do that :-) - It allows settings to be added by metadata to non fully converted forms
Comments
Credit notes prefix is pulled out of the invoicing section and into the metadata-defined section - as disabling invoicing does not enable the credit not prefix usage