Skip to content

IBX-11833: Added a unique field-type option to prevent duplicate Meta fields - #2012

Open
mateuszdebinski wants to merge 1 commit into
4.6from
IBX-11833-randomly-added-seo-field-when-editing-CT
Open

IBX-11833: Added a unique field-type option to prevent duplicate Meta fields#2012
mateuszdebinski wants to merge 1 commit into
4.6from
IBX-11833-randomly-added-seo-field-when-editing-CT

Conversation

@mateuszdebinski

@mateuszdebinski mateuszdebinski commented Aug 17, 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 unique flag lets a field type opt out of the group-scoped check so it's only ever added once, regardless of group.

For QA:

Documentation:

@sonarqubecloud

Copy link
Copy Markdown

@mateuszdebinski mateuszdebinski changed the title IBX-11833: Added unique for fieldType to prevent add more than one field in Meta IBX-11833: Added a unique field-type option to prevent duplicate Meta fields Aug 17, 2026

@ViniTou ViniTou 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.

Is this really the best place to add buisness logic like this into presentation (admin-ui) layer? what if that content type is going to be created outside it?

@barw4 barw4 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.

I wonder if this whole subject shouldn't be handled on core side as Type\Field::isUnique() or similar (same thing as @ViniTou noticed)


foreach ($metaFieldTypes as $metaFieldTypeIdentifier => $metaFieldTypeSettings) {
$fieldGroup = $this->getDefaultMetaDataFieldTypeGroup() ?? $this->fieldsGroupsList->getDefaultGroup();
$fieldTypeGroup = $metaFieldTypeSettings['unique'] ? null : $fieldGroup;

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.

can we make stricter comparison here?

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