#177 - Don't let people create a page name the same as a class name

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@49186 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-02-07 03:39:51 +00:00
parent c2f1785ff6
commit 9b9cf01f48

View File

@ -541,12 +541,6 @@ JS;
FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);"); FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);");
} }
if( ($record->class != 'VirtualPage') && $originalURLSegment != $record->URLSegment) {
$message .= sprintf(_t('LeftAndMain.CHANGEDURL'," Changed URL to '%s'"),$record->URLSegment);
FormResponse::add("\$('Form_EditForm').elements.URLSegment.value = \"$record->URLSegment\";");
FormResponse::add("\$('Form_EditForm_StageURLSegment').value = \"{$record->URLSegment}\";");
}
// After reloading action // After reloading action
if($originalStatus != $record->Status) { if($originalStatus != $record->Status) {
$message .= sprintf(_t('LeftAndMain.STATUSTO'," Status changed to '%s'"),$record->Status); $message .= sprintf(_t('LeftAndMain.STATUSTO'," Status changed to '%s'"),$record->Status);
@ -554,6 +548,12 @@ JS;
$record->write(); $record->write();
if( ($record->class != 'VirtualPage') && $originalURLSegment != $record->URLSegment) {
$message .= sprintf(_t('LeftAndMain.CHANGEDURL'," Changed URL to '%s'"),$record->URLSegment);
FormResponse::add("\$('Form_EditForm').elements.URLSegment.value = \"$record->URLSegment\";");
FormResponse::add("\$('Form_EditForm_StageURLSegment').value = \"{$record->URLSegment}\";");
}
// If the 'Save & Publish' button was clicked, also publish the page // If the 'Save & Publish' button was clicked, also publish the page
if (isset($urlParams['publish']) && $urlParams['publish'] == 1) { if (isset($urlParams['publish']) && $urlParams['publish'] == 1) {
$this->performPublish($record); $this->performPublish($record);