The "frontend-editing-field-wrapper" for the entity reference field is added even if all bundles enabled for this field are disabled in the Frontend Editing module settings

Created on 26 September 2023, 9 months ago
Updated 5 October 2023, 9 months ago

Problem/Motivation

The "frontend-editing-field-wrapper" wrapper for the entity reference field is added even if all bundles enabled for this field are disabled in the Frontend Editing module settings.

Steps to reproduce

For example:
1. Create a "Carousel item" paragraph type.
2. Create a "Carousel" paragraph type and add the "field_carousel_items" field with the reference to the "Carousel item" paragraphs.
3. Add the entity reference revision field to the node type and allow the "Carousel" paragraph.
4. Go to the Frontend Editing module settings: "/admin/config/frontend-editing/entity-bundle-restrictions" and enable the "Carousel" paragraph type only.
5. Add a node with the "Carousel" and "Carousel item" paragraphs.

Result:
The "field_carousel_items" allows to addition of the "Carousel item" paragraphs only which is disabled in the module settings but will have a "frontend-editing-field-wrapper" wrapper in the markup.

Proposed resolution

Add an additional condition in the "frontend_editing_entity_view_alter" hook.

if (empty(array_intersect($settings['handler_settings']['target_bundles'], $supported_entity_types[$settings['target_type']]))) {
  continue;
}
πŸ› Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

πŸ‡΅πŸ‡±Poland sygnetica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024