Skip to content

Conversation

Abdulmajeed-Jamaan
Copy link
Contributor

Updated the context passed to mountAction for field options to only include 'recordKey' if the section has an 'id' key. This prevents potential errors when a new section is created in the EditForm page.

Updated the context passed to mountAction for field options to only include 'recordKey' if the section has an 'id' key. This prevents potential errors when 'id' is missing from the section array.
@Abdulmajeed-Jamaan Abdulmajeed-Jamaan added the bug Something isn't working label Oct 14, 2025
Copy link

what-the-diff bot commented Oct 14, 2025

PR Summary

  • Improved Context Handling in Before Validate Method
    The beforeValidate method in the file EditForm.php has been updated. This improvement helps handling context more effectively when setting up actions for field options.

  • Conditional Check for Record Key Inclusion
    We've added a condition in the code that includes the recordKey in the context array if, and only if, the id exists in the section. This adjustment makes our system smarter, saving computing resources by avoiding unnecessary operations.

  • Enhanced Clarity with Named Parameters
    To make our code easier to understand, we've used named parameters for the mountAction method. This change will make maintaining and updating the code much simpler in the future.

@atmonshi atmonshi merged commit 613c3ca into 4.x Oct 16, 2025
2 of 5 checks passed
@atmonshi atmonshi deleted the fix/field-options-with-new-created-sections branch October 16, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants