Problem/Motivation

If we have a view with multiple displays for example:
Display 1
Display 2
Feed 1 (attached to display 1)
Feed 2 (attached to display 2)

The method getAttachedDisplays() when called on the display handler for Display 1 will return [Feed 1, Feed 2] instead of the expected [Feed 1].

Proposed resolution

// Go through all displays and search displays which link to this one.
    foreach ($this->view->storage->get('display') as $display_id => $display) {
      if (isset($display['display_options']['displays'])) {
        $displays = $display['display_options']['displays'];
        if (isset($displays[$current_display_id])) {
          $attached_displays[] = $display_id;
        }
      }
    }

if (isset($displays[$current_display_id])) needs an extra check for !empty($displays[$current_display_id]) because for the feed displays, the value $displays[$current_display_id] is set but is 0 if the feed is not attached.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3458785

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

minirobot created an issue. See original summary.

minirobot’s picture

Version: 11.0.x-dev » 11.x-dev

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.