Clicking "Done" does not redirect to the latest draft as expected

Created on 17 April 2025, 7 days ago

Problem/Motivation

When editing a "Draft" node under content moderation, clicking "Done" redirects back to the canonical url for the node. I would expect it to redirect to the latest revision.

In the MercuryEditorEntityFormTrait::processRedirectUrl there is the following check

      if ($entity instanceof RevisionableInterface && ($entity->isDefaultRevision() || $entity->isLatestRevision())) {
        $element['#value'] = $entity->toUrl('canonical', ['absolute' => TRUE])->toString();
      }
      else {
        $element['#value'] = $entity->toUrl('latest-version', ['absolute' => TRUE])->toString();
      }

It doesn't look like $entity->isDefaultRevision() ever returns true, but $entity->isLatestRevision() always returns true.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pixelwhip

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024