Files
zoneminder/web/includes/actions/monitor.php
Isaac Connor f26dee598e fix: surface DB error when new monitor insert fails fixes #4944
The insert branch only logged via ZM\Error and returned, leaving
$error_message empty. The dispatcher then re-rendered views/monitor.php
with no banner and the user saw an apparent success that silently
discarded their new monitor.

Append $monitor->get_last_error() to $error_message so the existing
<div id="error"> in getBodyTopHTML() shows the actual DB message, and
keep the early return so the user stays on the edit view with the form
values preserved by views/monitor.php's $_REQUEST['newMonitor'] handling.
Matches the pattern already used on the update path at line 273.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-27 12:07:22 -04:00

15 KiB