6.0.0-beta1
8/6/25

[#1274] Moving ticket doesn't reset version
Summary Moving ticket doesn't reset version
Queue Whups
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at)
Requester jan (at) horde (dot) org
Created 01/28/2005 (7495 days ago)
Due
Updated 04/02/2005 (7431 days ago)
Assigned 01/28/2005 (7495 days ago)
Resolved 04/02/2005 (7431 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/02/2005 05:45:51 AM bo Comment #3
State ⇒ Resolved
Reply to this comment
Patch updated slightly and committed. Thanks!
01/29/2005 09:37:10 AM olli (dot) korhonen (at) iki (dot) fi Comment #2
New Attachment: ticket_version_reset.patch Download
Reply to this comment
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


01/28/2005 07:45:03 PM Jan Schneider Comment #1
State ⇒ Assigned
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Moving ticket doesn't reset version
Queue ⇒ Whups
Assigned to Horde DevelopersHorde Developers
Reply to this comment
If moving a ticket from a queue with versions to a queue without 
versions, the version of the ticket doesn't get reset (or emptied).

Saved Queries