Extension migration files to enable links in ACP Quick Access

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Mike-on-Tour
Registered User
Posts: 159
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael
Contact:

Extension migration files to enable links in ACP Quick Access

Post by Mike-on-Tour »

In the German phpBB board I was confronted with the question why one of my extensions would produce an error message while calling the original ACP Extensions module if a second module was set up in the Quick Access section. After testing I had to admit that this indeed is the case. Some more investigation by the OP brought the result that this is the case with many extensions (he was able to find only one extension that works flawlessly in both cases).
This was the starting point to investigate and what I found is that a link to the same ACP module in the Extensions tab and in the Quick Access section of the General tab is working for both locations only if the setting names in the migration file (module_mode) differs from the names in the modes array in the acp/xxx_info.php file.
Since the Extensions Doc (https://area51.phpbb.com/docs/dev/3.2.x ... index.html) leads to the conclusion that these should be the same the question arises why this works only if the mode names are different? Does anybody have an explanation?

If you want to check this behavior for yourselves please download the attached extension zip files.
Unpack and install version 0.0.1, try the link in the Extensions tab to ascertain that it works (it will show a list of user groups used by your board) and then install a link in the Quick Access section (via the System tab's Module Management), try this link and then the original link in the Extensions tab. In this version the modes have equal names in the migration file and the _info.php file.

Then deactivate and delete the module from the Quick Access section, deactivate the extension, delete all its files and upload those from the ver. 0.0.2 zip file. After activation the mode names differ and it is no problem to get the group list through both links. (The two new migration files do nothing but remove the old module and add the new one with just a different name in module_mode; the if clause in both files is only to ensure a clean deinstall and data deletion.)

Since attaching zip files is not allowed please use this download links:
mot_test_0.0.1.zip
mot_test_0.0.2.zip
Watz fo lunch?
If you like my extensions and maybe want to buy me lunch: Image
Post Reply

Return to “Extension Writers Discussion”