pegasus
Well-known member
While writing Setup classes for add-ons, I have been fighting with
Why? The
In some situations even Entities (such as XF:BbCode) invoke relations such as
I propose a number of better solutions to this:
XF:DevelopmentOutput
. Whenever I need to write Entities with XF:DevOutputWritable
Behavior, I need to explicitly interact with each Entity, get the Behavior, and set the option write_dev_output to false before saving; I cannot use XenForo's built-in repository code for making quick updates to things like Options for example (like if an option's format has changed between versions, and we need to migrate old values).Why? The
XF:DevOutputWritable
behavior will create a new _output folder with only the touched add-on data in it, and the final XML import steps will read from that sparse _output folder rather than from _data. So basically no templates, routes, or anything get imported.In some situations even Entities (such as XF:BbCode) invoke relations such as
XF:phrase
, where it is not possible to change the Behavior at all (class-extensions not being imported yet/or disabled by the add-on's is_processing flag).I propose a number of better solutions to this:
- Allow direct interaction with
XF:DevelopmentOutput
. Add methods like ::enable(), ::disable(), ::addSkippedAddOn. This way we can just disable it in the Setup steps if we need to, and don't have to recode things that are already in core. It may be prudent to just make the add-on installer/upgrader automatically ::addSkippedAddOn the add-on that is being installed/upgraded, due to the above reasons. - Ensure that relations using
XF:DevOutputWritable
, if they are invoked by an entity also with that Behavior, inherit the write_dev_output value of the parent that invoked them.
Last edited by a moderator:
Upvote
1