diff --git a/code/extensions/LeftAndMainSubsites.php b/code/extensions/LeftAndMainSubsites.php index 84f2dc4d..7eb5c055 100644 --- a/code/extensions/LeftAndMainSubsites.php +++ b/code/extensions/LeftAndMainSubsites.php @@ -345,7 +345,7 @@ public function copytosubsite($data, $form) { $page = DataObject::get_by_id(SiteTree::class, $data['ID']); $subsite = DataObject::get_by_id('Subsite', $data['CopyToSubsiteID']); - $includeChildren = (isset($data['CopyToSubsiteWithChildren'])) ? $data['CopyToSubsiteWithChildren'] : false; + $includeChildren = isset($data['CopyToSubsiteWithChildren']) ? $data['CopyToSubsiteWithChildren'] : false; $newPage = $page->duplicateToSubsite($subsite->ID, $includeChildren); $response = $this->owner->getResponse(); diff --git a/code/pages/SubsitesVirtualPage.php b/code/pages/SubsitesVirtualPage.php index d1b7a3ea..023dfb93 100644 --- a/code/pages/SubsitesVirtualPage.php +++ b/code/pages/SubsitesVirtualPage.php @@ -140,7 +140,7 @@ public function fieldLabels($includerelations = true) public function getCopyContentFromID_SubsiteID() { - return ($this->CopyContentFromID) ? (int)$this->CopyContentFrom()->SubsiteID : (int)Session::get('SubsiteID'); + return $this->CopyContentFromID ? (int)$this->CopyContentFrom()->SubsiteID : (int)Session::get('SubsiteID'); } public function getVirtualFields() @@ -204,7 +204,7 @@ public function validURLSegment() // Veto the validation rules if its false. In this case, some logic // needs to be duplicated from parent to find out the exact reason the validation failed. if (!$isValid) { - $IDFilter = ($this->ID) ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null; + $IDFilter = $this->ID ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null; $parentFilter = null; if (Config::inst()->get(SiteTree::class, 'nested_urls')) {