Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uhf 9767 preview revision form fix #711

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,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(),
Loading