FIX: permission migrator for missing groups

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66103 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2008-11-18 01:28:37 +00:00 committed by Sam Minnee
parent 63866493e7
commit a14afe10d4

View File

@ -31,8 +31,8 @@ class UpgradeSiteTreePermissionSchemaTask extends BuildTask {
$pageIDs = DB::query("SELECT ID FROM SiteTree")->column('ID');
foreach($pageIDs as $pageID) {
$page = DataObject::get_by_id('SiteTree', $pageID);
if($page->ViewersGroup) $page->ViewerGroups()->add($page->ViewersGroup);
if($page->EditorsGroup) $page->EditorGroups()->add($page->EditorsGroup);
if($page->ViewersGroup && DataObject::get_by_id("Group", $page->ViewersGroup)) $page->ViewerGroups()->add($page->ViewersGroup);
if($page->EditorsGroup && DataObject::get_by_id("Group", $page->EditorsGroup)) $page->EditorGroups()->add($page->EditorsGroup);
$page->destroy();
unset($page);