mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Update README.md
Subsite::currentSubsiteID() is deprecated. class_exists needs a fully-qualified class name to work
This commit is contained in:
parent
81e6d0fe59
commit
644b9c8b90
@ -139,8 +139,8 @@ To limit your admin gridfields to the current Subsite records, you can do someth
|
|||||||
$form = parent::getEditForm($id, $fields);
|
$form = parent::getEditForm($id, $fields);
|
||||||
|
|
||||||
$gridField = $form->Fields()->fieldByName($this->sanitiseClassName($this->modelClass));
|
$gridField = $form->Fields()->fieldByName($this->sanitiseClassName($this->modelClass));
|
||||||
if(class_exists('Subsite')){
|
if(class_exists(Subsite::class)){
|
||||||
$list = $gridField->getList()->filter(array('SubsiteID'=>Subsite::currentSubsiteID()));
|
$list = $gridField->getList()->filter(['SubsiteID'=>Subsite::currentSubsiteID()]);
|
||||||
$gridField->setList($list);
|
$gridField->setList($list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user