fix: CLI snapshot delete uses file_path instead of data_file column #184

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

Summary

SnapshotCommand.php:230-234 references $record->file_path when the actual DB column is data_file. The CLI mokosuitebackup:snapshot delete silently skips file deletion, leaving orphaned JSON files on disk.

Location

source/packages/plg_console_mokosuitebackup/src/Command/SnapshotCommand.php:230-234

Fix

Change $record->file_path to $record->data_file.

## Summary `SnapshotCommand.php:230-234` references `$record->file_path` when the actual DB column is `data_file`. The CLI `mokosuitebackup:snapshot delete` silently skips file deletion, leaving orphaned JSON files on disk. ## Location `source/packages/plg_console_mokosuitebackup/src/Command/SnapshotCommand.php:230-234` ## Fix Change `$record->file_path` to `$record->data_file`.
Author
Owner

Branch created: feature/184-fix-cli-snapshot-delete-uses-file-path-i

git fetch origin
git checkout feature/184-fix-cli-snapshot-delete-uses-file-path-i
Branch created: [`feature/184-fix-cli-snapshot-delete-uses-file-path-i`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteBackup/src/branch/feature/184-fix-cli-snapshot-delete-uses-file-path-i) ```bash git fetch origin git checkout feature/184-fix-cli-snapshot-delete-uses-file-path-i ```
Author
Owner

Confirmed @ 02.56.05 — keep open.

plg_console_mokosuitebackup/src/Command/SnapshotCommand.php:230-234 still references $record->file_path, but the snapshots table column is data_file (sql/install.mysql.sql:75data_file VARCHAR(512), "Absolute path to JSON snapshot file"). There is no file_path column, so is_file($record->file_path) is always empty and file deletion is silently skipped. One-line fix: use data_file.

Confirmed @ 02.56.05 — keep open. `plg_console_mokosuitebackup/src/Command/SnapshotCommand.php:230-234` still references `$record->file_path`, but the snapshots table column is `data_file` (`sql/install.mysql.sql:75` — `data_file VARCHAR(512)`, "Absolute path to JSON snapshot file"). There is no `file_path` column, so `is_file($record->file_path)` is always empty and file deletion is silently skipped. One-line fix: use `data_file`.
Sign in to join this conversation.