Commit:    00fe8330f2972ff00f8c07834e871b8e5e6d3759
Author:    Sherif Ramadan <[email protected]>         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");


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to