Skip to content

IBX-10289: Fixed image picker when Image type has no 'tags' field#1821

Open
papcio122 wants to merge 3 commits into4.6from
IBX-10289_Can't-embed-image-after-removing-tags-field
Open

IBX-10289: Fixed image picker when Image type has no 'tags' field#1821
papcio122 wants to merge 3 commits into4.6from
IBX-10289_Can't-embed-image-after-removing-tags-field

Conversation

@papcio122
Copy link
Contributor

🎫 Issue IBX-10289

Description:

Stop image aggregations from being added when the Image content type has no required field.

@papcio122 papcio122 marked this pull request as draft February 5, 2026 09:24
@papcio122 papcio122 force-pushed the IBX-10289_Can't-embed-image-after-removing-tags-field branch from 16b1152 to 5a9bee7 Compare February 10, 2026 11:28
@papcio122 papcio122 force-pushed the IBX-10289_Can't-embed-image-after-removing-tags-field branch from 5a9bee7 to 0282d85 Compare February 10, 2026 11:32
@sonarqubecloud
Copy link

@papcio122 papcio122 marked this pull request as ready for review February 10, 2026 11:59
@papcio122 papcio122 requested a review from a team February 10, 2026 11:59
];

// The content type may not have the default fields; in that case, don't add the aggregations
$imageType = $this->contentTypeService->loadContentType(self::IMAGE_TYPE_ID);
Copy link
Member

Choose a reason for hiding this comment

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

Please do not hardcode database IDs. There's no guarantee on a real instance, that a given ID will reference what you need it to reference.

  1. Add to ibexa.dam_widget.image.mappings.image DI parameter contentTypeIdentifier: image key-value and use it as $this->config['image']['contentTypeIdentifier'].

  2. Load the content type using loadContentTypeByIdentifier instead.

  3. Make sure to handle NotFoundException as there's no guarantee an instance has image content type defined (or defined using that identifier). In such case an error should be logged.

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.

5 participants