Skip to content

Add new trigger for custom fields to manage the form before display in the backend#38423

Closed
roland-d wants to merge 1 commit intojoomla:4.2-devfrom
roland-d:feature/custom-field-show-default-value
Closed

Add new trigger for custom fields to manage the form before display in the backend#38423
roland-d wants to merge 1 commit intojoomla:4.2-devfrom
roland-d:feature/custom-field-show-default-value

Conversation

@roland-d
Copy link
Copy Markdown
Contributor

@roland-d roland-d commented Aug 8, 2022

Pull Request for Issue #38244

Summary of Changes

The new menuitem field cannot use nor has any use for the Default value field. Since there is no switch we can use to set this field a new plugin trigger has been added with the name onCustomFieldsPreprocessForm which can be picked up by the custom fields plugins.

Using this new trigger we can remove the Default value from the form and the mentioned error will not happen.

Testing Instructions

  1. Create a new custom field for Articles of the type List of Menu Items
  2. Set a default value as abc
  3. Save the custom field
  4. Edit or create a new article
  5. The page won't load the article edit form but will show an error on the page.
  6. Apply this pull request
  7. Reload the page or restart from step 4
  8. The page loads as expected and you can edit/create the article

Actual result BEFORE applying this Pull Request

Page crashed with a fatal error

Expected result AFTER applying this Pull Request

The content editing page loads as expected an article can be edited/created.

Documentation Changes Required

Yes, plugin trigger onCustomFieldsPreprocessForm needs to be documented.

…n the backend

Hide the default field for the menuitem custom field

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
@roland-d roland-d closed this Aug 8, 2022
@roland-d roland-d deleted the feature/custom-field-show-default-value branch August 8, 2022 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants