[Rt-commit] rt branch, 3.999-trunk, updated. 215466d7a7857f34eefcc71366c01086227dc433

sartak at bestpractical.com sartak at bestpractical.com
Tue Dec 1 05:56:30 EST 2009


The branch, 3.999-trunk has been updated
       via  215466d7a7857f34eefcc71366c01086227dc433 (commit)
      from  3ef58d570de32ed1385149b8802c6c17b5af1fda (commit)

Summary of changes:
 lib/RT/Model/Ticket.pm |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

- Log -----------------------------------------------------------------
commit 215466d7a7857f34eefcc71366c01086227dc433
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Dec 1 05:56:16 2009 -0500

    Re-enable validate_status since it seems to work now

diff --git a/lib/RT/Model/Ticket.pm b/lib/RT/Model/Ticket.pm
index 0f2bd0e..4354b24 100755
--- a/lib/RT/Model/Ticket.pm
+++ b/lib/RT/Model/Ticket.pm
@@ -432,10 +432,6 @@ sub create {
     #Now that we have a queue, Check the ACLS
     die caller unless $self->current_user->id;
 
-    unless ( $queue_obj->status_schema->is_valid( $args{'status'} ) ) {
-        return ( 0, 0, _('Invalid value for status') );
-    }
-
     #Since we have a queue, we can set queue defaults
 
     #Initial priority
@@ -2054,19 +2050,22 @@ Returns false otherwise.
 
 =cut
 
-# XXX, FIXME: disable this for a while, as it conflicts with workflows
-#sub validate_status {
-#    my $self   = shift;
-#    my $status = shift;
-#
-#    #Make sure the status passed in is valid
-#    unless ( $self->queue->status_schema->is_valid($status) ) {
-#        return (undef);
-#    }
-#
-#    return (1);
-#
-#}
+sub validate_status {
+    my $self     = shift;
+    my $status   = shift;
+    my $other    = shift;
+    my $metadata = shift;
+
+    my $queue = $self->queue_id || $other->{queue};
+    my $queue_obj = RT::Model::Queue->new;
+    $queue_obj->load($queue);
+
+    if ( $queue_obj->status_schema->is_valid($status) ) {
+        return 1;
+    }
+
+    return undef;
+}
 
 
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list