fix: duplicate pre-update backup from system and content plugins #186

Open
opened 2026-06-29 14:40:30 +00:00 by jmiller · 2 comments
Owner

Summary

Both plg_system_mokosuitebackup and plg_content_mokosuitebackup subscribe to onExtensionBeforeUpdate and both trigger a backup. The system plugin has a 10-minute throttle, the content plugin has a 1-hour throttle. Under certain timing conditions, two backups can run for a single update.

Additionally, the content plugin subscribes to onExtensionBeforeInstall and onExtensionBeforeUpdate — these are installer-group events in Joomla 6, not content-group events. The content plugin may be dead code for these events.

Fix

Remove the extension event handlers from the content plugin (leave them in the system plugin only). Or consolidate into a single plugin.

## Summary Both `plg_system_mokosuitebackup` and `plg_content_mokosuitebackup` subscribe to `onExtensionBeforeUpdate` and both trigger a backup. The system plugin has a 10-minute throttle, the content plugin has a 1-hour throttle. Under certain timing conditions, two backups can run for a single update. Additionally, the content plugin subscribes to `onExtensionBeforeInstall` and `onExtensionBeforeUpdate` — these are installer-group events in Joomla 6, not content-group events. The content plugin may be dead code for these events. ## Fix Remove the extension event handlers from the content plugin (leave them in the system plugin only). Or consolidate into a single plugin.
Author
Owner

Branch created: feature/186-fix-duplicate-pre-update-backup-from-sys

git fetch origin
git checkout feature/186-fix-duplicate-pre-update-backup-from-sys
Branch created: [`feature/186-fix-duplicate-pre-update-backup-from-sys`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteBackup/src/branch/feature/186-fix-duplicate-pre-update-backup-from-sys) ```bash git fetch origin git checkout feature/186-fix-duplicate-pre-update-backup-from-sys ```
Author
Owner

Confirmed still open @ 02.56.05 — keep open.

Both plugins still handle the update event: plg_content_mokosuitebackup/src/Extension/MokoSuiteBackupContent.php:28-29 subscribes to onExtensionBeforeInstall and onExtensionBeforeUpdate, while plg_system_mokosuitebackup/src/Extension/MokoSuiteBackup.php:31 also subscribes to onExtensionBeforeUpdate — so a single extension update triggers two pre-update backups. Fix: remove the installer-group event handlers from the content plugin (backups belong to the system plugin).

Confirmed still open @ 02.56.05 — keep open. Both plugins still handle the update event: `plg_content_mokosuitebackup/src/Extension/MokoSuiteBackupContent.php:28-29` subscribes to `onExtensionBeforeInstall` **and** `onExtensionBeforeUpdate`, while `plg_system_mokosuitebackup/src/Extension/MokoSuiteBackup.php:31` also subscribes to `onExtensionBeforeUpdate` — so a single extension update triggers two pre-update backups. Fix: remove the installer-group event handlers from the content plugin (backups belong to the system plugin).
Sign in to join this conversation.