phptek / silverstripe-jsontext

JSON storage and querying
Other
22 stars 12 forks source link

Allow onBeforeWrite to be triggered from any controller extending LeftAndMain #18

Closed tim-lar closed 1 year ago

tim-lar commented 5 years ago

Currently, JSONTextExtension::onBeforeWrite() requires that the current controller be CMSPageEditController. This restricts the use of this extension on any ModelAdmin controllers.

This change just checks that the current controller is a subclass of LeftAndMain, which every controller in the CMS should be.

dcentrica commented 1 year ago

I'm so sorry this took so long to address. Looking at the code, the section you're referring to no longer exists and the Controller subclass is no longer specified. The logic is now just checking the current instance via Controller::curr().

I'm closing this MR now. Thanks (and sorry once again).