XF 2.0 Still confused by how the legacy_addon_id option works...

Jaxel

Well-known member
#1
So I have an addon... For XF1, it added some tables. I upgraded this addon for XF2... the XF2 version uses different tables.

If I DON'T use the legacy_addon_id option... then there will be issues with installing the new version, because it does share some of the same template, options and phrase names.

If I DO use the legacy_addon_id option... then there will be issues because it won't run the install steps for the new version.

What would be the best way to take care of this?
 

DragonByte Tech

Well-known member
#2
As I believe I said last time, to successfully use the legacy_addon_id option, make sure the version ID (not the visible version string, the internal identifier) is higher than the XF1 version, then construct the XF2 Setup.php file as if you are upgrading from an old version.


Fillip
 

Jeremy P

Well-known member
#4
You wouldn't duplicate it, you'd just write the steps necessary to upgrade from versions prior (ie, rename the tables and whatever else).

If you do find you need to duplicate something, you could always abstract it out to a protected method and call that from both the install and upgrade steps.
 
Top