Skip to content

Fix #756: Correct malformed UPDATE SET clause in notify list delete - #794

Open
bmfmancini wants to merge 2 commits into
Cacti:developfrom
bmfmancini:fix/issue-756-malformed-sql-notify-lists
Open

Fix #756: Correct malformed UPDATE SET clause in notify list delete#794
bmfmancini wants to merge 2 commits into
Cacti:developfrom
bmfmancini:fix/issue-756-malformed-sql-notify-lists

Conversation

@bmfmancini

Copy link
Copy Markdown
Member

Summary

Fixes #756

In notify_lists.php, the bulk delete flow (drp_action == 1) contained a malformed SQL statement for the host email reset:

UPDATE host
SET thold_host_email = 0
AND deleted=""
WHERE ...

The AND deleted="" was incorrectly placed in the SET clause as part of the assignment expression, rather than in the WHERE clause as a filter condition.

Impact

  • The deleted="" filter was not applied as intended.
  • The expression semantics were incorrect and could silently produce unintended updates.

Fix

Moved the deleted="" filter from the SET clause to the WHERE clause, matching the structure of the adjacent thold_send_email update queries in the same function:

UPDATE host
SET thold_host_email = 0
WHERE deleted=""
AND ...

Testing

  • Verified PHP syntax with php -l notify_lists.php — no syntax errors.
  • The corrected query now matches the pattern used by the two thold_send_email updates immediately above it in the same delete path.

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.
Copilot AI lite review requested due to automatic review settings August 17, 2026 02:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: notify list delete action uses malformed UPDATE SET clause for host email reset

2 participants