From 0ae9bfd93a130d29880f3765b963108482092bf4 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 5 Jul 2026 20:15:30 -0500 Subject: [PATCH] fix: restore missing subject arg in MokoRestore str_replace (standalone gen) MokoRestore::generateStandaloneScript() rewrites the 'Backup Archive' pre-check via str_replace(ORIG, REPL) but was missing the third $php subject argument, so every standalone-mode backup fatally errored with 'str_replace() expects at least 3 arguments, 2 given' at the 'Generating standalone restore.php...' step. The archive still finalized and uploaded, but no restore.php was produced -- the underlying cause of #226 (restore script missing on the remote). Refs #226 Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i --- CHANGELOG.md | 1 + source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de1626b..4d684f15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] ### Fixed +- Standalone restore script generation no longer aborts backups with `str_replace() expects at least 3 arguments, 2 given`. `MokoRestore::generateStandaloneScript()` had a `str_replace()` call (the "Backup Archive" pre-check rewrite) that was missing its `$php` subject argument, so **every** standalone-mode backup fatally errored while "Generating standalone restore.php…" — the archive still finalized and uploaded, but no `restore.php` was ever produced (the true root cause behind #226). (#226) - Remote upload: the standalone restore script upload is no longer silent — its result is now checked and logged, and a failed restore-script upload marks the backup as `warning` (previously the result was discarded, so a missing restore script on the remote went unreported while the archive still showed success). (#226) ## [02.58.00] --- 2026-07-06 diff --git a/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php b/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php index eb6ea0aa..1d06801b 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php +++ b/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php @@ -204,7 +204,8 @@ ORIG, 'ok' => $backupCount > 0, 'hint' => 'Place one or more backup ZIP files in the same directory as ' . basename($_SERVER['SCRIPT_NAME']), ]; -REPL +REPL, + $php ); /* Modify remaining pre-checks to use getSelectedBackupFile() */