Skip to content

IBX-8753: Improved ModifyFieldDefinitions logic #1614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: 4.6
Choose a base branch
from
Open

Conversation

tbialcz
Copy link
Contributor

@tbialcz tbialcz commented Jun 30, 2025

🎫 Issue IBX-8753

Description:

This PR extends the ModifyFieldDefinitionFieldsSubscriber to support the following:

  • Accepting multiple FieldTypeIdentifiers instead of a single one.
  • Applying field modifications conditionally based on a provided SpecificationInterface.
  • Keeping backward compatibility by accepting both string and string[] in the constructor.
  • Updated logic in onPreSetData to check the provided SpecificationInterface against the content type being edited.

For QA:

Documentation:

Copy link
Member

@adamwojs adamwojs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 but we need to improve code readability. I think we can start by splitting onPreSetData logic into several small private methods: https://gist.github.com/adamwojs/e1934ded9bceb3eb92d1f7b8f5c23fdc

@tbialcz tbialcz changed the title IBX-8753: Added ContentTypeIsCompany specification and improved ModifyFieldDefinitions logic IBX-8753: Improved ModifyFieldDefinitions logic Jul 2, 2025
… readability and encapsulate logic with helper methods
@tbialcz tbialcz requested review from adamwojs and a team July 2, 2025 08:56
@ezrobot ezrobot requested review from mikadamczyk, Steveb-p, alongosz, ciastektk, ViniTou, barw4, wiewiurdp and konradoboza and removed request for a team July 2, 2025 08:57
Comment on lines +39 to +41
string $fieldTypeIdentifier,
array $modifiedOptions,
$fieldIdentifiers = [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there two parameters that are named in the exact same way ($fieldIdentifier and $fieldIdentifiers)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s no $fieldIdentifier parameter — only $fieldTypeIdentifier (string) and $fieldIdentifiers (array).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about deprecating passing string into it, and just keep array for 5.0?
@ibexa/php-dev

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants