Hi, i can't get Subsites (2.4-compat) working on SS 2.4.9.
$this->owner->Subsite() does not return an Object anymore? Can anybody help?
Greetings, Carsten.
ERROR [Notice]: Trying to get property of non-object
IN POST /admin/getitem?ID=30&locale=de_DE&ajax=1
Line 95 in /home/www/22/42/cwflade787/subsites/code/SiteTreeSubsites.php
Source
======
86:
87: parent::onBeforeWrite();
88: }
89:
90: function updateCMSFields(&$fields) {
91: if($this->owner->MasterPageID) $fields->insertFirst(new HeaderField('This page\'s content is
copied from a master page: ' . $this->owner->MasterPage()->Title, 2));
92:
93: // replace readonly link prefix
94: $subsite = $this->owner->Subsite();
* 95: if($subsite && $subsite->ID) {
96: $baseUrl = 'http://' . $subsite->domain() . '/';
97: $fields->removeByName('BaseUrlLabel');
98: $fields->addFieldToTab(
99: 'Root.Content.Metadata',
100: new LabelField('BaseUrlLabel',$baseUrl),
101: 'URLSegment'