fix: preserve download keys (dlid) across Joomla extension updates #187

Open
opened 2026-06-06 12:02:10 +00:00 by jmiller · 1 comment
Owner

Summary

Joomla's extension installer can wipe the extra_query column in #__update_sites when rebuilding or reinstalling update sites. This column stores download keys (dlid) needed for commercial extension updates. This is a known Joomla bug that affects all extensions, not just MokoWaaS.

Root Cause

Joomla's installer recreates update site rows from manifest XML during install/upgrade. Since the dlid is user-entered data not present in the manifest, the extra_query value is lost. The "Rebuild" button in Update Sites also clears it silently.

References:

Solution

Added preserveDownloadKeys() to the core plugin. On every admin page load it:

  1. Reads all extra_query values from #__update_sites
  2. Backs up non-empty values to administrator/cache/mokowaas_dlkeys.json
  3. If any previously-backed-up keys are now empty, restores them automatically
  4. Cleans up backup entries for deleted update sites

Lightweight check -- single SELECT query per page load, writes only when changes detected.

Files Changed

  • Extension/MokoWaaS.php -- added preserveDownloadKeys() method, called from onAfterInitialise (admin only)
## Summary Joomla's extension installer can wipe the extra_query column in #__update_sites when rebuilding or reinstalling update sites. This column stores download keys (dlid) needed for commercial extension updates. This is a known Joomla bug that affects all extensions, not just MokoWaaS. ## Root Cause Joomla's installer recreates update site rows from manifest XML during install/upgrade. Since the dlid is user-entered data not present in the manifest, the extra_query value is lost. The "Rebuild" button in Update Sites also clears it silently. References: - https://github.com/joomla/joomla-cms/issues/32592 - https://github.com/joomla/joomla-cms/issues/37204 - https://www.akeeba.com/news/1746-working-around-joomla-s-broken-extensions-updater.html ## Solution Added preserveDownloadKeys() to the core plugin. On every admin page load it: 1. Reads all extra_query values from #__update_sites 2. Backs up non-empty values to administrator/cache/mokowaas_dlkeys.json 3. If any previously-backed-up keys are now empty, restores them automatically 4. Cleans up backup entries for deleted update sites Lightweight check -- single SELECT query per page load, writes only when changes detected. ## Files Changed - Extension/MokoWaaS.php -- added preserveDownloadKeys() method, called from onAfterInitialise (admin only)
Author
Owner

Branch created: feature/187-fix-preserve-download-keys-dlid-across-j

git fetch origin
git checkout feature/187-fix-preserve-download-keys-dlid-across-j
Branch created: [`feature/187-fix-preserve-download-keys-dlid-across-j`](https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/src/branch/feature/187-fix-preserve-download-keys-dlid-across-j) ```bash git fetch origin git checkout feature/187-fix-preserve-download-keys-dlid-across-j ```
Sign in to join this conversation.
No labels
Type
Status
Priority
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoWaaS#187