XF 2.0 How do "legacy" addons work?

Jaxel

Well-known member
My new XF2 addon has the ID of ""EWR\Porta"; it is an upgrade from my previous addon "EWRporta2". It has the following addon.json:
Code:
{
    "legacy_addon_id": "EWRporta2",
    "title": "[8WR] XenPorta 2 (Portal) PRO",
    "description": "Portal and featured threads manager. Add-on from 8WAYRUN.",
    "version_id": 1,
    "version_string": "0.0.0.1",
    "dev": "Jaxel",
    "dev_url": "https://xenforo.com/community/resources/authors/1295/",
    "faq_url": "",
    "support_url": "https://xenforo.com/community/resources/3894/",
    "extra_urls": [],
    "require": [],
    "icon": "fa-newspaper-o"
}

One of my beta testers, after installing this addon, had this happen:
0C1ACD5F-F6C6-44D3-96CF-E390EDBD32C4.webp

For some reason the new addon was placed into the legacy menu with the old addon...

Is this because the new addon is version 0.0.0.1?
 
The system essentially is used to allow you to change the add-on ID during upgrade.

We had a bug report about this, though we couldn't actually reproduce it, but really it's expected given that your new add-on does not represent an upgrade of the old version. Your new add-on version has a version_id of 1. To be a valid upgrade, the new version must have a higher version ID than the original version.

For the most part, the version_string doesn't make a difference. The version_id is what we use internally for comparing versions and detecting upgrades.
 
You have to ensure the version_id is higher than the XF1 version's version ID, otherwise it will not be seen as an upgrade. The version string is irrelevant, although you should probably also make it higher than the XF1 version.

EDIT: ninja'd :(


Fillip
 
Top Bottom