mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX CMSMain->delete()/deletefromlive() return to "Pages" overview when permanently deleting the record (= no readonly view available)
This commit is contained in:
parent
e9c7fb5e1e
commit
a097266ded
@ -687,8 +687,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// nothing to return
|
// Redirect to pages overview
|
||||||
return '';
|
return $this->redirect(singleton('CMSPagesController')->Link());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -765,7 +765,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($this->isAjax()) {
|
|
||||||
// need a valid ID value even if the record doesn't have one in the database
|
// need a valid ID value even if the record doesn't have one in the database
|
||||||
// (its still present in the live tables)
|
// (its still present in the live tables)
|
||||||
$liveRecord = Versioned::get_one_by_stage(
|
$liveRecord = Versioned::get_one_by_stage(
|
||||||
@ -773,7 +772,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
'Live',
|
'Live',
|
||||||
"\"SiteTree_Live\".\"ID\" = $recordID"
|
"\"SiteTree_Live\".\"ID\" = $recordID"
|
||||||
);
|
);
|
||||||
return ($liveRecord) ? $form->forTemplate() : "";
|
// If no live record exists, redirect to pages list
|
||||||
|
if(!$liveRecord) return $this->redirect(singleton('CMSPagesController')->Link());
|
||||||
|
|
||||||
|
if($this->isAjax()) {
|
||||||
|
$form = $this->getEditForm($liveRecord->ID);
|
||||||
|
return $form->forTemplate();
|
||||||
} else {
|
} else {
|
||||||
$this->redirectBack();
|
$this->redirectBack();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user