com web/master: Fixed issue with deleting user notes not working. The SQL needed to be adjusted from an inner join to a left join otherwise both
tables had to have a record for the delete to go through.: manage/user-notes.php

From: Date: Sat, 15 Dec 2012 01:51:36 +0000
Subject: com web/master: Fixed issue with deleting user notes not working. The SQL needed to be adjusted from an inner join to a left join otherwise both
tables had to have a record for the delete to go through.: manage/user-notes.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-15091@lists.php.net to get a copy of this message
Commit: 00fe8330f2972ff00f8c07834e871b8e5e6d3759 Author: Sherif Ramadan <googleguy@php.net> Fri, 14 Dec 2012 20:51:36 -0500 Parents: 603c838a745b4140b8c640862105d99a73b07458 Branches: master Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=00fe8330f2972ff00f8c07834e871b8e5e6d3759 Log: Fixed issue with deleting user notes not working. The SQL needed to be adjusted from an inner join to a left join otherwise both tables had to have a record for the delete to go through. Changed paths: M manage/user-notes.php Diff: diff --git a/manage/user-notes.php b/manage/user-notes.php index d384e23..d29d5cc 100644 --- a/manage/user-notes.php +++ b/manage/user-notes.php @@ -345,7 +345,7 @@ case 'reject': case 'delete': if ($id) { if ($row = note_get_by_id($id)) { - if ($row['id'] && db_query("DELETE note,votes FROM note INNER JOIN votes WHERE note.id = votes.note_id AND note.id = $id")) { + if ($row['id'] && db_query("DELETE note,votes FROM note LEFT JOIN (votes) ON (note.id = votes.note_id) WHERE note.id = $id")) { // ** alerts ** //$mailto .= get_emails_for_sect($row["sect"]); $action_taken = ($action == "reject" ? "rejected" : "deleted");

« previous php.webmaster (#15091) next »