Permalink
Browse files

MINOR Setting ID fields in CMSMain->getEditForm()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92659 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 61a3d03 commit b96a69d7161415eb5b0c4978fbf543551d45c87a @chillu chillu committed Nov 21, 2009
Showing with 2 additions and 5 deletions.
  1. +2 −5 code/CMSMain.php
View
@@ -365,15 +365,12 @@ public function getEditForm($id) {
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);
}
- $fields->push($idField = new HiddenField("ID"));
+ $fields->push($idField = new HiddenField("ID", false, $id));
$fields->push($liveURLField = new HiddenField("LiveURLSegment"));
$fields->push($stageURLField = new HiddenField("StageURLSegment"));
- /*if( substr($record->ID, 0, 3 ) == 'new' )*/
- $fields->push(new HiddenField('Sort','', $record->Sort ));
+ $fields->push(new HiddenField('Sort','', $record->Sort));
- $idField->setValue($id);
-
if($record->ID && is_numeric( $record->ID ) ) {
$liveRecord = Versioned::get_one_by_stage('SiteTree', 'Live', "\"SiteTree\".\"ID\" = $record->ID");
if($liveRecord) $liveURLField->setValue($liveRecord->AbsoluteLink());

0 comments on commit b96a69d

Please sign in to comment.