mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
BUG: redirect to pages overview not working from page edit view
The redirect to pages overview was not working because the pages overview and page edit views share the same session namespace, and therefore the checks to see if we need to redirect to pages overview (i.e. if there is a translated record for the current page) matched also for the redirected request. Fixed by checking if we already are on the CMSPagesController before redirecting to it.
This commit is contained in:
parent
c3c9f1f83f
commit
451576f36d
@ -44,7 +44,7 @@ class TranslatableCMSMainExtension extends Extension {
|
|||||||
$transPage->ID
|
$transPage->ID
|
||||||
// ?locale will automatically be added
|
// ?locale will automatically be added
|
||||||
));
|
));
|
||||||
} else {
|
} else if ($this->owner->class != 'CMSPagesController') {
|
||||||
// If the record is not translated, redirect to pages overview
|
// If the record is not translated, redirect to pages overview
|
||||||
return $this->owner->redirect(Controller::join_links(
|
return $this->owner->redirect(Controller::join_links(
|
||||||
singleton('CMSPagesController')->Link(),
|
singleton('CMSPagesController')->Link(),
|
||||||
|
Loading…
Reference in New Issue
Block a user