[Tickets #1274] Moving ticket doesn't reset version

bugs at bugs.horde.org bugs at bugs.horde.org
Sat Jan 29 01:37:10 PST 2005


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=1274
-----------------------------------------------------------------------
 Ticket     | 1274
 Updated By | olli.korhonen at iki.fi
 Summary    | Moving ticket doesn't reset version
 Queue      | Whups
 State      | Assigned
 Priority   | 1. Low
 Type       | Bug
 Owners     | Horde Developers
+Attachment | ticket_version_reset.patch
-----------------------------------------------------------------------


olli.korhonen at iki.fi (2005-01-29 01:37) wrote:

Hi,

I am just a newbie in Horde so don't get mad if I'm far out.

How about this solution? I'm not quite sure about the sql.php part though.
Version is the only nullable column in whups_tickets table, so I wonder if
it is ok to do it this way. Although there may be some other nullable
columns in the future.

Index: whups/lib/Ticket.php
===================================================================
RCS file: /repository/whups/lib/Ticket.php,v
retrieving revision 1.27
diff -u -3 -p -u -r1.27 Ticket.php
--- whups/lib/Ticket.php        12 Jan 2005 17:04:45 -0000      1.27
+++ whups/lib/Ticket.php        29 Jan 2005 09:27:31 -0000
@@ -246,6 +246,15 @@ class Whups_Ticket {
                 }
                 break;

+            case 'queue':
+                // Reset version if new queue is not versioned
+                $newQueue = $whups->getQueue($value['name']);
+                if (!$newQueue['versioned']) {
+                    $updates['version'] = '';
+                }
+                $updates['queue'] = $value['name'];
+                break;
+
             default:
                 $updates[$detail] = $value;
             }
Index: whups/lib/Driver/sql.php
===================================================================
RCS file: /repository/whups/lib/Driver/sql.php,v
retrieving revision 1.208
diff -u -3 -p -u -r1.208 sql.php
--- whups/lib/Driver/sql.php    19 Jan 2005 15:07:40 -0000      1.208
+++ whups/lib/Driver/sql.php    29 Jan 2005 09:27:32 -0000
@@ -323,7 +323,11 @@ class Whups_Driver_sql extends Whups_Dri
                 continue;
             }

-            $query .= $this->_map[$field] . ' = ' .
$this->_db->quote(String::convertCharset($value, NLS::getCharset(),
$this->_params['charset'])) . ', ';
+            if (empty($value)) {
+                $query .= $this->_map[$field] . ' = NULL, ';
+            } else {
+                $query .= $this->_map[$field] . ' = ' .
$this->_db->quote(String::convertCharset($value, NLS::getCharset(),
$this->_params['charset'])) . ', ';
+            }
         }

         /* Don't try to execute an empty query (if we didn't find any





More information about the bugs mailing list