diff --git a/changelogs/DP-41303.yml b/changelogs/DP-41303.yml new file mode 100644 index 0000000000..cb49b181da --- /dev/null +++ b/changelogs/DP-41303.yml @@ -0,0 +1,41 @@ +# +# Write your changelog entry here. Every pull request must have a changelog yml file. +# +# Change types: +# ############################################################################# +# You can use one of the following types: +# - Added: For new features. +# - Changed: For changes to existing functionality. +# - Deprecated: For soon-to-be removed features. +# - Removed: For removed features. +# - Fixed: For any bug fixes. +# - Security: In case of vulnerabilities. +# +# Format +# ############################################################################# +# The format is crucial. Please follow the examples below. For reference, the requirements are: +# - All 3 parts are required and you must include "Type", "description" and "issue". +# - "Type" must be left aligned and followed by a colon. +# - "description" must be indented with 2 spaces followed by a colon +# - "issue" must be indented with 4 spaces followed by a colon. +# - "issue" is for the Jira ticket number only e.g. DP-1234 +# - No extra spaces, indents, or blank lines are allowed. +# +# Example: +# ############################################################################# +# Fixed: +# - description: Fixes scrolling on edit pages in Safari. +# issue: DP-13314 +# +# You may add more than 1 description & issue for each type using the following format: +# Changed: +# - description: Automating the release branch. +# issue: DP-10166 +# - description: Second change item that needs a description. +# issue: DP-19875 +# - description: Third change item that needs a description along with an issue. +# issue: DP-19843 +# +Changed: + - description: Pages linking here should show only latest revisions. + issue: DP-41303 diff --git a/docroot/modules/custom/mass_entity_usage/src/Controller/ListUsageController.php b/docroot/modules/custom/mass_entity_usage/src/Controller/ListUsageController.php index aa62df9520..9617c41fb1 100644 --- a/docroot/modules/custom/mass_entity_usage/src/Controller/ListUsageController.php +++ b/docroot/modules/custom/mass_entity_usage/src/Controller/ListUsageController.php @@ -176,6 +176,10 @@ public function prepareRows($usages) { // If for some reason this record is broken, just skip it. continue; } + // Skip if it is not the latest revision. + if (!$source_entity->isLatestRevision()) { + continue; + } $field_definitions = $this->entityFieldManager->getFieldDefinitions($source_type, $source_entity->bundle()); $default_key = count($records) - 1;