BUGFIX: Don't run migration code for permissions if the old field doesn't exist.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64462 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2008-10-16 22:46:48 +00:00
parent 509f14d6ae
commit d3f6b8ec9e

View File

@ -320,7 +320,7 @@ class Permission extends DataObject {
parent::requireDefaultRecords();
// Add default content if blank
if(!DB::query("SELECT ID FROM Permission")->value()) {
if(!DB::query("SELECT ID FROM Permission")->value() && array_key_exists('CanCMSAdmin', DB::fieldList('Group'))) {
$admins = DB::query("SELECT ID FROM `Group` WHERE CanCMSAdmin = 1")
->column();
@ -611,4 +611,4 @@ class Permission_Group {
}
?>
?>