- Issue created by @idebr
- π¦πΊAustralia acbramley
Nice find @idebr, tested locally and the call to createRevision will fix this for Diff. I'm going to work on this today.
I'll also open a follow up to have NodeRevisionRevertForm extend RevisionRevertForm as there's a lot of duplication there.
- π³π±Netherlands idebr
Test coverage shows the issue is fixed. Contrib tests in π Fix tests (next minor) Active are fixed as well with this change. Thanks!
- π¨πSwitzerland berdir Switzerland
We can clean a bit then, left a comment.
I also verified that \Drupal\node\Form\NodeRevisionRevertTranslationForm::prepareRevertedRevision does this correctly.
Hi, Iβm new to the issue queue ,I setup a fresh Drupalβ―11.2 site and tried the above mention steps to replicate the bugs,After the revert, a new revision shows up in the list and is marked as the current one, so everything looks normal on my end.Is there another condition that I need to add to see the bug?Let me know and Iβll test again.
- π³π±Netherlands idebr
I added a screencast on a new Drupal standard installation on 11.2.x with steps to reproduce
@idebr Thanks for checking it out.Please try making some changes while editing the content, then save it. Once saved, try reverting the content to see if the issue reproduces.
- π¬π§United Kingdom alexpott πͺπΊπ
// The node should retain the translations from the last default revision. // @see \Drupal\Core\Entity\ContentEntityStorageBase::createRevision. $this->assertTrue($node->hasTranslation('it'));
This feels like a massive change of expectations. If you revert to a revision before a translation a translation has been created I would not expect translations that were added afterwards to exist. I don't know but this choice seems deliberate.
Are we sure this change is correct?
- π¦πΊAustralia acbramley
@alexpott that's exactly what
ContentEntityStorageBase::createRevision
is documented to do from what I'm reading. Without this fix, reverting a Node to a more recent revision that is not current (i.e clicking Set as current revision) has a really weird outcome and essentially bugs out the revision list (try running the tests without the fix and looking at the HTML output or debugging yourself).