Problem/Motivation

Entity displays depend on the bundle entity if there is one. If there is not they should depend on the provider of the entity type so they are removed when that module is uninstalled.

Proposed resolution

Fix Drupal\entity\EntityDisplayBase::calculateDependencies to add the dependency.

Remaining tasks

  • Write patch
  • Review

User interface changes

None

API changes

Additional dependencies in entity displays.

Files: 
CommentFileSizeAuthor
#3 2261677.3-interdiff.txt522 bytesBerdir
#3 2261677.3.patch3.76 KBBerdir
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 70,611 pass(es). View
#2 2261677.2.patch3.79 KBalexpott
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 70,603 pass(es). View
#2 1-2-interdiff.txt894 bytesalexpott
#1 2261677.1.patch2.39 KBalexpott
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 70,608 pass(es). View

Comments

alexpott’s picture

Status: Active » Needs review
FileSize
2.39 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 70,608 pass(es). View

Not the trickiest thing to fix :)

alexpott’s picture

FileSize
894 bytes
3.79 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 70,603 pass(es). View

Forgot to update the default configuration in standard profile. This shows why I missed this - because user is a required module and therefore I didn't notice entity.view_display.user.user.default was missing an obvious dependency on the user module but aggregator provides an entity type without a bundle entity type so that's why I noticed whilst looking at #2261425: Streamline aggregator's entities rendering with rest of core

Berdir’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
3.76 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 70,611 pass(es). View
522 bytes

Looks good, verified that all default form and view displays have correct dependencies. Just fixed a missing newline at the end of one of those files.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

  • Commit 3e7383d on 8.x by catch:
    Issue #2261677 by alexpott, Berdir: Entity displays need to depend on...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.