mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX 7617: Back button in CMS after Add/Edit/View action in GridField does not work
This commit is contained in:
parent
155758f546
commit
78038eb75e
@ -328,11 +328,15 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
|
||||
$form->addExtraClass('cms-content cms-edit-form center ss-tabset');
|
||||
$form->setAttribute('data-pjax-fragment', 'CurrentForm Content');
|
||||
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||
// TODO Link back to controller action (and edited root record) rather than index,
|
||||
// which requires more URL knowledge than the current link to this field gives us.
|
||||
// The current root record is held in session only,
|
||||
// e.g. page/edit/show/6/ vs. page/edit/EditForm/field/MyGridField/....
|
||||
$form->Backlink = $toplevelController->hasMethod('Backlink') ? $toplevelController->Backlink() : $toplevelController->Link();
|
||||
|
||||
if($toplevelController->hasMethod('Backlink')) {
|
||||
$form->Backlink = $toplevelController->Backlink();
|
||||
} elseif($this->popupController->hasMethod('Breadcrumbs')) {
|
||||
$parents = $this->popupController->Breadcrumbs(false)->items;
|
||||
$form->Backlink = array_pop($parents)->Link;
|
||||
} else {
|
||||
$form->Backlink = $toplevelController->Link();
|
||||
}
|
||||
}
|
||||
|
||||
$cb = $this->component->getItemEditFormCallback();
|
||||
|
Loading…
Reference in New Issue
Block a user