Revision: 1647
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1647&view=rev
Author:   cimorrison
Date:     2010-11-25 09:18:20 +0000 (Thu, 25 Nov 2010)

Log Message:
-----------
Better fix (again!) for Rev 1642 (bug causing approval of entries not to work 
when using PostgreSQL)

Revision Links:
--------------
    http://mrbs.svn.sourceforge.net/mrbs/?rev=1642&view=rev

Modified Paths:
--------------
    mrbs/trunk/web/mrbs_sql.inc

Modified: mrbs/trunk/web/mrbs_sql.inc
===================================================================
--- mrbs/trunk/web/mrbs_sql.inc 2010-11-25 07:39:09 UTC (rev 1646)
+++ mrbs/trunk/web/mrbs_sql.inc 2010-11-25 09:18:20 UTC (rev 1647)
@@ -698,16 +698,14 @@
   {
     // First update the repeat table
     $sql = "UPDATE $tbl_repeat 
-               SET status=status" . sql_syntax_bitwise_xor() . 
STATUS_AWAITING_APPROVAL . "
-             WHERE id=$id
-               AND status&" . STATUS_AWAITING_APPROVAL . ">0";
+               SET status=status&(~" . STATUS_AWAITING_APPROVAL . ")
+             WHERE id=$id";
     if (sql_command($sql) > 0)  // We expect there to be one row affected
     {
       // Then update the entry table
       $sql = "UPDATE $tbl_entry 
-                 SET status=status" . sql_syntax_bitwise_xor() . 
STATUS_AWAITING_APPROVAL . "
-               WHERE repeat_id=$id
-                 AND status&" . STATUS_AWAITING_APPROVAL . ">0";
+                 SET status=status&(~" . STATUS_AWAITING_APPROVAL . ")
+               WHERE repeat_id=$id";
       // It's possible that there will be no rows affected if all the
       // entries have previously been individually approved
       return (sql_command($sql) >= 0);
@@ -720,9 +718,8 @@
   else
   {
     $sql = "UPDATE $tbl_entry 
-               SET status=status" . sql_syntax_bitwise_xor() . 
STATUS_AWAITING_APPROVAL . "
-             WHERE id=$id
-               AND status&" . STATUS_AWAITING_APPROVAL . ">0";
+               SET status=status&(~" . STATUS_AWAITING_APPROVAL . ")
+             WHERE id=$id";
     return (sql_command($sql) > 0);  // We expect there to be one row affected
   }
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to