Commit Graph
1 Commits
Author SHA1 Message Date
Isaac ConnorandClaude Opus 4.8 04f097b9c0 fix: surface export copy failures and stop output accumulating fixes #5085
exportEvents() copies each event file with exec($cmd, $output, $return)
and only put $return into a ZM\Debug line, so a failed cp never reached
the user and the export still handed back an archive missing files - the
"fails silently" half of #5074. $output was also never reset between
iterations, and exec() appends to a non-empty array, so that Debug line
accumulated every line of output from every file in the export.

Reset $output before each copy, and on a non-zero return log a ZM\Error
and mark the export failed; after the loop, return false when any copy
failed so ajax/event.php reports "Export Failed" instead of serving an
incomplete archive, matching how the tar/zip step already handles its
own exec() status.

tests/php/test_export_copy_failure.php extracts the exportEvents() body
from the real source and checks the reset and the failure handling are
present; it fails against the pre-fix source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-08 18:07:30 -05:00