Skip to content

Commit

Permalink
Allow Galleries to exist anywhere if a Holder doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
purplespider committed Mar 5, 2014
1 parent 9246d50 commit 1b0b005
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/PhotoGalleryPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getCMSFields() {
function onBeforeWrite() {

// Move to Photo Gallery Holder if created under something else
if ($this->Parent()->ClassName != "PhotoGalleryHolder") {
if ($this->Parent()->ClassName != "PhotoGalleryHolder" && PhotoGalleryHolder::get()->count() > 0) {
$this->ParentID = PhotoGalleryHolder::get()->first()->ID;
}

Expand Down

0 comments on commit 1b0b005

Please sign in to comment.