Fix #756: Correct malformed UPDATE SET clause in notify list delete - #794
Fix #756: Correct malformed UPDATE SET clause in notify list delete#794bmfmancini wants to merge 2 commits into
Conversation
The host email reset query in the notify list delete action (drp_action == 1) used 'AND deleted=""' as part of the SET clause instead of the WHERE clause, causing the deleted filter to be ignored and potentially producing unintended updates. Moved the deleted filter from SET to WHERE.
somethingwithproof
left a comment
There was a problem hiding this comment.
Please do not merge this form. It carries the unrelated three-line #789 change, and its host update conflicts semantically with #773's transactional notification-list deletion: #773 deliberately clears thold_host_email for soft-deleted hosts too, so restoring a host cannot resurrect a reference to a deleted list. Rebase on #773 (or choose one implementation), keep the transactional prepared-query version, add a deletion/restoration Pest case through Cacti Composer, and add the CHANGELOG entry.
|
The four integration checks are using the older unpinned Cacti workflow and fail during Cacti setup before the plugin can be validated. Maintainer edits are disabled, so I cannot apply the pinned-Cacti and bounded-retry workflow fix. Please enable maintainer edits or update/rebase the branch. |
Summary
Fixes #756
In
notify_lists.php, the bulk delete flow (drp_action == 1) contained a malformed SQL statement for the host email reset:The
AND deleted=""was incorrectly placed in theSETclause as part of the assignment expression, rather than in theWHEREclause as a filter condition.Impact
deleted=""filter was not applied as intended.Fix
Moved the
deleted=""filter from theSETclause to theWHEREclause, matching the structure of the adjacentthold_send_emailupdate queries in the same function:Testing
php -l notify_lists.php— no syntax errors.thold_send_emailupdates immediately above it in the same delete path.