dnadesign / silverstripe-elemental-virtual

Allows Content Blocks to be reused between pages.
BSD 3-Clause "New" or "Revised" License
7 stars 26 forks source link

BUGFIX: Fixed issue where the VirtualOwner would be set for every element on a page #54

Closed UndefinedOffset closed 1 year ago

UndefinedOffset commented 1 year ago

This pull request fixes an issue where the last virtual element on a page would cause all other elements on the page to have their VirtualOwner set to the last virtual element on the page. This is caused by extensions being singletons in Silverstripe 4. This pull request changes the DNADesign\ElementalVirtual\Extensions\BaseElementExtension class to use $this->owner->setField() and $this->owner->getField() to store the virtual owner rather than storing it as a protected variable on the extension.