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 |
State ⇒ Resolved
New Attachment: ticket_version_reset.patch
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
State ⇒ Assigned
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Moving ticket doesn't reset version
Queue ⇒ Whups
Assigned to
versions, the version of the ticket doesn't get reset (or emptied).