Update README.md

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
This commit is contained in:
Greg808 2019-06-27 17:32:11 +02:00 committed by GitHub
parent 001f44d73b
commit 9abaca6d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}