Skip to content

Commit

Permalink
Merge pull request #711 from City-of-Helsinki/UHF-9767_preview_revisi…
Browse files Browse the repository at this point in the history
…on_form_fix

Uhf 9767 preview revision form fix
  • Loading branch information
rpnykanen authored Mar 20, 2024
2 parents 8758358 + 107d84d commit fd977de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"[#UHF-885] Helfi-specific customizations to EU Cookie Compliance": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/923b35f699820b544397a35b7696570e101cd02c/patches/eu_cookie_compliance_block_8.x-1.24.patch",
"[#UHF-8720] Missing config schema for dependencies (https://www.drupal.org/i/3330024)": "https://www.drupal.org/files/issues/2022-12-28/config_dependencies_schema-3330024-2.patch"
},
"drupal/diff": {
"Revision overview form problem, issue 3390329": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/5100132105528b7047b154787afd6459e5e10e18/patches/revision_overview_form.patch"
},
"drupal/paragraphs": {
"https://www.drupal.org/project/paragraphs/issues/2904705#comment-13836790": "https://www.drupal.org/files/issues/2020-09-25/2904705-115.patch",
"[#UHF-2059] Enhancements for the Admin UI": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/fdccb32397cc6fa19b4d0077b21a2b18aa6be297/patches/helfi_customizations_for_paragraphs_widget_8.x-1.12.patch"
Expand Down
18 changes: 18 additions & 0 deletions patches/revision_overview_form.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/src/Form/RevisionOverviewForm.php b/src/Form/RevisionOverviewForm.php
index 45c2c66..4ff4f3b 100755
--- a/src/Form/RevisionOverviewForm.php
+++ b/src/Form/RevisionOverviewForm.php
@@ -209,7 +209,12 @@ class RevisionOverviewForm extends FormBase {
}
/** @var \Drupal\Core\Entity\ContentEntityInterface $revision */
if ($revision = $node_storage->loadRevision($vid)) {
- if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {
+ // Added key-check to always show the current revision on revision list.
+ // Check this issue: https://www.drupal.org/project/drupal/issues/3390329.
+ if (
+ $revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected() ||
+ $key === 0 && $revision->hasTranslation($langcode)
+ ) {
$username = array(
'#theme' => 'username',
'#account' => $revision->getRevisionUser(),

0 comments on commit fd977de

Please sign in to comment.