Skip to content
Snippets Groups Projects

Fixed forwarding URL detection and added test for use case.

2 files
+ 13
12
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -292,7 +292,7 @@ trait MercuryEditorEntityFormTrait {
@@ -292,7 +292,7 @@ trait MercuryEditorEntityFormTrait {
public function processRedirectUrl(array $element, FormstateInterface $form_state) {
public function processRedirectUrl(array $element, FormstateInterface $form_state) {
$entity = $this->tempstore->get($this->entity->uuid());
$entity = $this->tempstore->get($this->entity->uuid());
if ($entity->id()) {
if ($entity->id()) {
if ($entity instanceof RevisionableInterface && $entity->isDefaultRevision()) {
if ($entity instanceof RevisionableInterface && ($entity->isDefaultRevision() || $entity->isLatestRevision())) {
$element['#value'] = $entity->toUrl('canonical', ['absolute' => TRUE])->toString();
$element['#value'] = $entity->toUrl('canonical', ['absolute' => TRUE])->toString();
}
}
else {
else {
Loading