XF 2.0 legacy_addon_id for renaming XF2 Addon?

Sim

Well-known member
Wondering if we could utilise the legacy_addon_id field in our addon.json to rename an XF2 addon to a different addon_id?

If we were to set the is_legacy field in the xf_addon table to true for the old addon - would the system remove the old addon and move the option fields to the new addon_id like it does for an XF1 addon?

I've only looked through the code briefly and haven't actually tried it yet to see if it works - wondering if anyone had any thoughts or insights into what else happens behind the scenes with upgrading legacy addons?
 
Just FYI - tried this on my test server and it worked perfectly!

I actually think this should be made a feature - it is conceivable that devs may need to rename their addon_id. It would be useful to give forum operators an upgrade path so that settings and data are not lost as it potentially would be if it were simply released as a new addon.

Something simple along the lines of an addon admin UI menu option to "mark this addon as legacy" which simply flips the is_legacy flag.

I'll create a suggestion.
 
Well we don't actually have a UI for managing add ons generally so this would sort of go against that.

It's possible we actually had this use case in mind all along hence why it works and IIRC the default addon.json includes it so, much like all of the other properties, setting it directly in the JSON is all we’d recommend so probably not worth a suggestion to be honest.
 
Well we don't actually have a UI for managing add ons generally so this would sort of go against that.

It's possible we actually had this use case in mind all along hence why it works and IIRC the default addon.json includes it so, much like all of the other properties, setting it directly in the JSON is all we’d recommend so probably not worth a suggestion to be honest.

I meant the existing UI for installed Addons - see suggestion here: https://xenforo.com/community/threads/mark-this-addon-as-legacy-for-renaming-xf2-addon_id.152291/

From the developer's point of view, all we need to do is set the legacy_addon_id in the addon.json

But there's an extra step required by forum administrators to make the upgrade work - they need to be able to mark the installed addon as a legacy addon so that the system knows to disable the old addon and migrate the settings to the new addon - which is what the suggestion is about.
 
Back
Top Bottom