[Bps-public-commit] rt-extension-formtools branch, master, updated. 0.16-3-g90a73ae
Jim Brandt
jbrandt at bestpractical.com
Tue May 27 14:02:27 EDT 2014
The branch, master has been updated
via 90a73ae5ea7026f1fc4aec21cac22c9b09c1ccd9 (commit)
from 575d82ec887869430af2c4bf292cec23a7d19ab1 (commit)
Summary of changes:
html/FormTools/Field | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 90a73ae5ea7026f1fc4aec21cac22c9b09c1ccd9
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Tue May 27 13:57:08 2014 -0400
Clarify that we are clearing the context object
Make it clear that we are clearing the context object that
had been set to global context. We aren't setting the context
to the ticket because in the final case where LoadByName
is called, $ticket is undef.
This workaround is only needed for RT 4.2.0 - 4.2.4. LoadByName
is refactored in 4.2.5 to correctly set the context object.
diff --git a/html/FormTools/Field b/html/FormTools/Field
index 1c6667b..35accdc 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -45,8 +45,9 @@ if ( RT::Extension::FormTools::is_core_field($name) ) {
$cf->LoadByName( Name => $name, Queue => $queue->id ) if (defined $queue);
$cf->LoadByName( Name => $name, Queue => 0 ) unless ( $cf->id );
unless ( $cf->Id ) {
- # Reset context object to ticket because previous call made it global
- $cf->SetContextObject($ticket) if $cf->can('SetContextObject');
+ # Clear context object because previous call made it global
+ # Not needed for RT >= 4.2.5 where this is fixed in LoadByName
+ $cf->SetContextObject(undef) if $cf->can('SetContextObject');
$cf->LoadByName( Name => $name );
}
unless ( $cf->id ) {
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list