[Bps-public-commit] rt-extension-formtools branch, queue-and-global-cfs, created. 0.07_05-2-geba88a2
Kevin Falcone
falcone at bestpractical.com
Mon Jun 6 15:36:05 EDT 2011
The branch, queue-and-global-cfs has been created
at eba88a2803cb88fe15658d944b9699c042571ac0 (commit)
- Log -----------------------------------------------------------------
commit 35daccbd264c19e29d2aac4acfd2b43327c8502a
Author: Kevin Falcone <kevin at jibsheet.com>
Date: Mon Jun 6 14:39:35 2011 -0400
Revert "Search for global and queue-specific CFs"
Not passing a Queue is documented to get you a global OR queue CF.
This means if you have 2 Custom Fields named the same assigned to 2
queues, you'll get a random one.
This reverts commit 947926ead4a2fff8c48f224c60e2ac162f362293.
diff --git a/html/FormTools/Field b/html/FormTools/Field
index 4ea313c..6e25e34 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -42,7 +42,7 @@ if ( RT::Extension::FormTools::is_core_field($name) ) {
$cf = RT::CustomField->new( $session{'CurrentUser'} );
$cf->SetContextObject($ticket) if $cf->can('SetContextObject');
- $cf->LoadByName( Name => $name );
+ $cf->LoadByName( Name => $name, Queue => $queue->id );
unless ( $cf->id ) {
die "Could not find a custom field called $name for the queue "
. $queue->Name;
commit eba88a2803cb88fe15658d944b9699c042571ac0
Author: Kevin Falcone <kevin at jibsheet.com>
Date: Mon Jun 6 15:34:28 2011 -0400
Be more explicit about what we want to load
LoadByName without a Queue argument just looks for the first CF with the
requested Name. This could be a CF on another queue or global or on this
queue. Instead, look for the current queue and then look for global, but
don't find an identically named CF which is assigned to a completely
different Queue.
diff --git a/html/FormTools/Field b/html/FormTools/Field
index 6e25e34..e9ba723 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -42,8 +42,13 @@ if ( RT::Extension::FormTools::is_core_field($name) ) {
$cf = RT::CustomField->new( $session{'CurrentUser'} );
$cf->SetContextObject($ticket) if $cf->can('SetContextObject');
+
+ # try loading CFs for this Queue, followed by Global
$cf->LoadByName( Name => $name, Queue => $queue->id );
unless ( $cf->id ) {
+ $cf->LoadByName( Name => $name, Queue => 0 );
+ }
+ unless ( $cf->id ) {
die "Could not find a custom field called $name for the queue "
. $queue->Name;
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list