Skip to content

IBX-11833: Added check if field is singular to prevent add to CT - #2060

Open
mateuszdebinski wants to merge 2 commits into
4.6from
IBX-11833-unpredictably-added-seo-field-when-editing-CT
Open

IBX-11833: Added check if field is singular to prevent add to CT#2060
mateuszdebinski wants to merge 2 commits into
4.6from
IBX-11833-unpredictably-added-seo-field-when-editing-CT

Conversation

@mateuszdebinski

@mateuszdebinski mateuszdebinski commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-11833

Related PRs:

Description:

A field type could get duplicated into a Content Type when its resolved field group differed from where an existing instance already lived (e.g., SEO metadata re-added on edit). The SEO field type has an isSingular function that returns true, which means that the field can only be added once to the CT.

This PR introduces verification if field is singular before adding metafields to the CT, including the SEO field.

For QA:

Documentation:

@konradoboza konradoboza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please check if cases in tests/lib/Service/MetaFieldType/MetaFieldDefinitionServiceTest.php can be merged into dataProvider as it seems the major part of those is duplicated.

Comment thread tests/lib/Service/MetaFieldType/MetaFieldDefinitionServiceTest.php
Comment thread tests/lib/Service/MetaFieldType/MetaFieldDefinitionServiceTest.php
Comment thread tests/lib/Service/MetaFieldType/MetaFieldDefinitionServiceTest.php Outdated
Comment thread tests/lib/Service/MetaFieldType/MetaFieldDefinitionServiceTest.php Outdated
Comment thread src/lib/Service/MetaFieldType/MetaFieldDefinitionService.php Outdated
@mateuszdebinski
mateuszdebinski force-pushed the IBX-11833-unpredictably-added-seo-field-when-editing-CT branch from 9b63bba to e8920a2 Compare September 8, 2026 09:11
Comment thread tests/lib/Service/MetaFieldType/MetaFieldDefinitionServiceTest.php
Comment thread tests/lib/Service/MetaFieldType/MetaFieldDefinitionServiceTest.php
@mateuszdebinski
mateuszdebinski force-pushed the IBX-11833-unpredictably-added-seo-field-when-editing-CT branch from e8920a2 to 9f38089 Compare September 8, 2026 10:47
@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

Comment thread src/lib/Service/MetaFieldType/MetaFieldDefinitionService.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants