bbrala β credited enyug β .
larowlan β credited enyug β .
patch for core 10.0.9
public function revisionOverview(NodeInterface $node) {
$langcode = $node
->language()
->getId();
$langname = $node
->language()
->getName();
$languages = $node
->getTranslationLanguages();
$has_translations = count($languages) > 1;
$node_storage = $this
->entityTypeManager()
->getStorage('node');
$build['#title'] = $has_translations ? $this
->t('@langname revisions for %title', [
'@langname' => $langname,
'%title' => $node
->label(),
]) : $this
->t('Revisions for %title', [
'%title' => $node
->label(),
]);
I assume it should be consistence with what implemented in NodeController
Add revision history title callback
Regarding this:
@enyug is there a particular reason you forked at #224 rather than continuing from #234 or was that a typo?
I notice the changes after #224 prevent showing any other operations for default revision which could have other custom operations for it.
Hide revert link for latest revision, hide delete link for current revision, also include fix in #249
protected function prepareRevision(RevisionableInterface $revision, FormStateInterface $formState): void {
$revision->setNewRevision();
$revision->isDefaultRevision(TRUE);
+ assert($revision instanceof TranslatableRevisionableInterface);
+ // Apply the same behaviour in the node revisions.
+ $revision->setRevisionTranslationAffected(TRUE);
$time = $this->time->getRequestTime();
if ($revision instanceof EntityChangedInterface) {
$revision->setChangedTime($time);
Add this to match the behaviours in node revision, fix issue in #138 #145
foreach ($entityStorage->loadMultipleRevisions(array_keys($result)) as $revision) {
// Only show revisions that are affected by the language that is being
// displayed.
if (!$translatable || ($revision->hasTranslation($currentLangcode) && $revision->getTranslation($currentLangcode)->isRevisionTranslationAffected())) {
yield $revision;
}
}
Hi: @dpi, This will prevent revision showing which is default revision but has NULL in revision_translation_affected, as mentioned in #138 #145 by @acbramley