mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
elofgren:Display a useful error message if getCMSFields() returns null. Thanks Sam: http://www.silverstripe.com/general-discussion/flat/1537?showPost=2042#post2042
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41942 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2c07f001f2
commit
7463a8fb05
@ -279,6 +279,9 @@ JS;
|
||||
if($record->DeletedFromStage) $record->Status = _t('CMSMain.REMOVEDFD',"Removed from the draft site");
|
||||
|
||||
$fields = $record->getCMSFields($this);
|
||||
if ($fields == null) {
|
||||
user_error("getCMSFields returned null on a 'Page' 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($liveURLField = new HiddenField("LiveURLSegment"));
|
||||
$fields->push($stageURLField = new HiddenField("StageURLSegment"));
|
||||
|
Loading…
Reference in New Issue
Block a user