Don't allow all bundles if no target bundle is configured

Created on 12 June 2019, almost 6 years ago
Updated 2 February 2023, about 2 years ago

For security reasons, we took the explicit design decision that if no target bundle is configured, we shouldn't fall back to allowing all bundles.

However, DefaultSelection::validateConfigurationForm() still contains:

    // If no checkboxes were checked for 'target_bundles', store NULL ("all
    // bundles are referenceable") rather than empty array ("no bundle is
    // referenceable" - typically happens when all referenceable bundles have
    // been deleted).
    if ($form_state->getValue(['settings', 'handler_settings', 'target_bundles']) === []) {
      $form_state->setValue(['settings', 'handler_settings', 'target_bundles'], NULL);
    }

This is not a big problem, as the 'target_bundles' form element is #required anyway, so the case that an empty array is in the values to be validated may never occur. Even more, this means these lines should not be there.

This issue was split off πŸ“Œ Add Views EntityReference filter to be available for all entity reference fields Closed: duplicate .

πŸ“Œ Task
Status

Postponed: needs info

Version

10.1 ✨

Component
Entity  β†’

Last updated 3 days ago

Created by

Pancho UTC+2 πŸ‡ͺπŸ‡Ί EU

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024