Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
I am not quite sure if this is needed but i'd expect the code snipets to work with Silverstripe 4 if the requirement say Silverstripe 4. I testet it with SS 4.4.1
Subsite::currentSubsiteID() is deprecated.  class_exists needs namespace to work correctly
  • Loading branch information
Greg808 authored Jun 27, 2019
1 parent 001f44d commit 9abaca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ Include the current SubsiteID as a hidden field on getCMSFields, or updateCMSFie
:::php
public function getCMSFields() {
$fields = parent::getCMSFields();
if(class_exists('Subsite')){
$fields->push(new HiddenField('SubsiteID','SubsiteID', Subsite::currentSubsiteID()));
if(class_exists(Subsite::class)){
$fields->push(new HiddenField('SubsiteID','SubsiteID', SubsiteState::singleton()->getSubsiteId()));
}
return $fields;
}
Expand Down

0 comments on commit 9abaca6

Please sign in to comment.