Enforce per-profile retention and repair Purge Old Backups button #203
Reference in New Issue
Block a user
Delete Branch "fix/backup-retention-purge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two related backup-management fixes.
Retention ("records / days to keep")
retentionfieldset was defined inprofile.xmlbut never rendered in the profile editor, soretention_days/retention_countwere invisible. Now rendered on the Archive tab.RetentionManager::prune(), called fromcompleteRecord()in bothBackupEngineandSteppedBackupEngineafter a backup finishes.complete/warningbackup when either it is older thanretention_daysor it falls outside the newestretention_countcopies.0= unlimited for that rule. Deleting a record also removes its archive + log file.Purge Old Backups button
onclick, which Joomla 6's Atum toolbar does not render — so the button did nothing. Now wrapsJoomla.submitbuttonto open the modal for thebackups.purgeModaltask, keeping the selector as a fallback.Test plan
Two related backup-management fixes. Retention (records/days to keep): - The retention fieldset was defined in profile.xml but never rendered in the profile editor, so retention_days/retention_count were invisible. Render the retention fieldset on the Archive tab. - retention_days/retention_count were read by nothing, so they pruned no backups. Add RetentionManager::prune(), called from completeRecord() in both BackupEngine and SteppedBackupEngine after a backup finishes. Policy: delete a completed/warning backup when EITHER it is older than retention_days OR it falls outside the newest retention_count copies (0 = unlimited for that rule). Deleting a record also removes its archive and log file. - Correct misleading language/schema text ("use global default" — no such global backup-retention setting exists) to "0 = unlimited". Purge Old Backups button: - The modal only opened via a fragile selector match on the toolbar button's inline onclick, which Joomla 6's Atum toolbar does not render, so the button did nothing. Wrap Joomla.submitbutton to open the modal for the backups.purgeModal task, keeping the selector as a fallback.3bacf83d75to10248b284a