mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
ENHANCEMENT Removed manual SiteTree->Status setting in LeftAndMain controllers, use specific getters like SiteTree->IsAddedToStage for this purpose
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92745 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1308153458
commit
44e3966d96
@ -318,8 +318,6 @@ JS;
|
||||
if($record && !$record->canView()) return Security::permissionFailure($this);
|
||||
|
||||
if($record) {
|
||||
if($record->IsDeletedFromStage) $record->Status = _t('CMSMain.REMOVEDFD',"Removed from the draft site");
|
||||
|
||||
$fields = $record->getCMSFields($this);
|
||||
if ($fields == null) {
|
||||
user_error("getCMSFields returned null on a '".get_class($record)."' object - it should return a FieldSet object. Perhaps you forgot to put a return statement at the end of your method?", E_USER_ERROR);
|
||||
|
@ -546,15 +546,12 @@ class LeftAndMain extends Controller {
|
||||
$record = $this->getNewItem($SQL_id, false);
|
||||
}
|
||||
|
||||
// TODO Coupling to SiteTree
|
||||
$record->HasBrokenLink = 0;
|
||||
$record->HasBrokenFile = 0;
|
||||
|
||||
$record->writeWithoutVersion();
|
||||
|
||||
if(is_a($record, "Page")) {
|
||||
$record->Status = ($record->Status == "New page" || $record->Status == "Saved (new)") ? "Saved (new)" : "Saved (update)";
|
||||
}
|
||||
|
||||
// Update the class instance if necessary
|
||||
if($data['ClassName'] != $record->ClassName) {
|
||||
$newClassName = $record->ClassName;
|
||||
@ -710,7 +707,6 @@ JS;
|
||||
if($node && !$node->canEdit()) return Security::permissionFailure($this);
|
||||
|
||||
$node->ParentID = $parentID;
|
||||
$node->Status = "Saved (update)";
|
||||
$node->write();
|
||||
|
||||
$statusUpdates['modified'][$node->ID] = array(
|
||||
@ -763,7 +759,6 @@ JS;
|
||||
foreach($request->requestVar('ID') as $id) {
|
||||
if($id == $movedNode->ID) {
|
||||
$movedNode->Sort = ++$counter;
|
||||
$movedNode->Status = "Saved (update)";
|
||||
$movedNode->write();
|
||||
$statusUpdates['modified'][$movedNode->ID] = array(
|
||||
'TreeTitle'=>$movedNode->TreeTitle
|
||||
|
Loading…
x
Reference in New Issue
Block a user