From 9abaca6d489b358441dcc43e3d365f3fa566ac0b Mon Sep 17 00:00:00 2001 From: Greg808 <32903200+Greg808@users.noreply.github.com> Date: Thu, 27 Jun 2019 17:32:11 +0200 Subject: [PATCH] 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 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a910e2..67ff284 100644 --- a/README.md +++ b/README.md @@ -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; }