Problem/Motivation

By fixing #2761409: The latest revision isn't always the current revision we introduced an interesting bug.

When a multilingual site is setup the Node revisions page doesn't show a current revision for all of the translations.

Simple test scenario:

  • Create article in English.
  • Translate to German and save as a new revision.
  • Look at the revisions tab when you are on the English site. You will see only one translation and you do *not* see the current default revision.

So you don't see what is actually published right now.

Proposed resolution

Show all revisions effected by the current language, plus the default revision.

Remaining tasks

Review

User interface changes

Adds the current revision row within the revisions list.

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timmillwood created an issue. See original summary.

timmillwood’s picture

Status: Active » Needs review
FileSize
1.42 KB

Status: Needs review » Needs work

The last submitted patch, 2: entity_translation-2769741-2.patch, failed testing.

timmillwood’s picture

Fixing the test as the default revision is now shown even if it's not the same language.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Berdir’s picture

There is only *one* default revision. So if revisions are enabled by default, this situtation will be the normal case, not the exception, only one translation will be the default revision.

timmillwood’s picture

@Berdir - but this makes strange behavior, specifically looking at the UI example of the revisions page. It allows a list of revisions with no "current revision" listed.

Berdir’s picture

Absolutely. I'm saying it is worse than the issue description currently makes it sound. It sounds like "This might happen", but if you have revisions on by default, it is pretty much guaranteed to happen.

timmillwood’s picture

Issue tags: +Workflow Initiative
Berdir’s picture

I'm wondering if we need to somehow show why we show the default revision, despite not being affected in the current language?

Apart from that, this is fine with me. But it would be good to get a +1 from Gabor, mkalkbrenner and others that were involved in the refactoring of the revision UI to be filtered by translation.

Gábor Hojtsy’s picture

I think @mkalkbrenner and @hchonov would be the best to ask to take a look. I am not sure I even understand the problem by reading the issue summary twice, sorry.

timmillwood’s picture

Issue summary: View changes
Gábor Hojtsy’s picture

Issue summary: View changes
hchonov’s picture

The idea behind this revision overview filtered by language is that for the user there is no logic shown and for the user the revisions are per language and not per entity.

If we show the current default revision then on the revision overview I would

1. flag the current default revision somehow as the "current default revision" if it has the revisionTranslationAffected flag set
or
2. flag the current default revision somehow as the "current default revision without changes compared to %last_revision_with_translation_changes_for_current_language" or something similar if the revision has the revisionTranslationAffected flag set.

timmillwood’s picture

Status: Needs review » Needs work

@hchonov - I'll ping you about this later and we can discuss ideas. My main objective it just to show where the current revision is. For example if you want to revert to the revision before the current you wouldn't know which that is, because the revisons list can include forward revisions.

hchonov’s picture

As I've pointed in IRC, should we actually show forward revisions (drafts) on the revision overview page which is meant as a history overview or should we have another "drafts overview"? I personally would like the second one.

timmillwood’s picture

Knocked up a quick screencast to show the issue:
https://www.youtube.com/watch?v=zEY3eFf97-o

Here I have 5 revisions, 3 english 2 slovak. Two of the revisions are forward revisions, one on each language. The current / default revision is slovak, so the english revisions page shows no current revision.

tstoeckler’s picture

Issue tags: +Triaged core major

Discussed this at the Entity Field API triage meeting with core and Entity API maintainers and we agreed on the current classification as "major".

So I guess both #10 and #14 are hinting at the fact that we should probably add some sort of hint to the UI about why this revision shows up. While thinking about this and trying to come up with wording that normal people can at least somewhat reasonably understand, I was wondering the following: If the default revision did not affect the currently displayed language, the values displayed for the node in that language will be equal to those of the previous revision. So does it make sense to instead add the (Current revision) suffix to the previous revision and not add the current revision at all? If revisions are only created through the UI I'm fairly (though not 100%) certain that simply going back to the previous revision is a correct assumption, but I'm very unsure whether that holds when revisions are created through the API in their various forms.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

timmillwood’s picture

Status: Needs work » Needs review

Flipping back to "Needs review" to get more discussion here.

Looking at #18 are we thinking find the revision for a translation with the next revision ID lower than the default, then display that as the "current revision"?

timmillwood’s picture

Title: Entity translation might not have a default revision » Node revisions page might not list a default revision for translations

Giving a more suitable title.

tstoeckler’s picture

Re #20. Yes, pretty much. Unless I'm mistaken (which may very well be the case, so I implore everyone to think about this very critically) we should be able to incrementally go back in the list of revisions (by decrementing it one by one) and find the first one where the current translation is marked as affected and display that as "current".

vierlex’s picture

There is also somethin i came across while creating new revisions without any changes but having a revision log message.
The Revisions exist but dont show up in the 'revision' overview.

due to revision_translation_affected being 'null'

there are no other languages involved.

timmillwood’s picture

Status: Needs review » Needs work
hchonov’s picture

@vierlex, this is an expected behavior, because you haven't actually changed the content of the entity, but only the revision metadata information. However there is no point in altering the revision metadata information without actually making any content changes.

timodwhit’s picture

@vierlex, do you by chance know the back history or the issue where that decision was made? It is slightly confusing to not always see current_revision. Example: first time changing the state from draft to published you see current revision, but second time, you are not presented with what the current revision is, if you have a forward revision, etc.

@timmillwood, It seems like there should be more detail also given on this page. Would it make more sense to change the revisions table from a separate controller to a view and allow people to customize the data that is displayed, example: language, state, etc.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

dalin’s picture

Title: Node revisions page might not list a default revision for translations » Node revisions page might not list a default revision
Status: Needs work » Needs review

Given that

  • This affects mono-lingual sites too
  • From the content editor's perspective, it looks like there's data loss

I don't quite follow why this is back to "Needs Work".

My suggestion is to commit this patch (if it still applies), and to address any UX improvements to the list of revisions (either for all revisions lists, or just for translated ones) in a separate issue(s).

Berdir’s picture

Status: Needs review » Needs work

I'm not sure why this would affect monolingual sites and it is for example needs work because the patch is 4 years old and doesn't apply anymore.

Bunty Badgujar’s picture

Assigned: Unassigned » Bunty Badgujar
Bunty Badgujar’s picture

Assigned: Bunty Badgujar » Unassigned
Status: Needs work » Needs review
FileSize
4.46 KB

Updating #2 for 9.1.x, interdiff is not required.

Status: Needs review » Needs work

The last submitted patch, 36: 2769741-36.patch, failed testing. View results

Bunty Badgujar’s picture

This bug is already take care in other issue [#2938947]

Screenshot showing default revision for each language without any patch.
Translation EN
Translation DE

joseph.olstad’s picture

I'm currently developing the etuf module (entity_translation_unified_form) , there's some pretty tricky/strange things going on between some transition states, I'm noticing revisions labeled as 'Publish' that are actually 'draft' revisions, the current revision is still published , I'm hoping this patch might help.

scouring the issue queues for something that might help.
I will continue this battle tomorrow only 4 minutes left on sunday.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.