[Rt-commit] r17256 - rt/3.8/trunk/share/html/Elements

elacour at bestpractical.com elacour at bestpractical.com
Tue Dec 16 10:14:42 EST 2008


Author: elacour
Date: Tue Dec 16 10:14:42 2008
New Revision: 17256

Modified:
   rt/3.8/trunk/share/html/Elements/EditCustomField

Log:
Fix the following problems:
- If customfield validation fails on Ticket web creation, then we loose
  selected customfield values of CF type "select multiple values". User need to
  select them again.
- If customfield edition is activated (via callback) on Ticket/Update.html and
  we wan't to enforce CF validation, then same problem appears.

Modified: rt/3.8/trunk/share/html/Elements/EditCustomField
==============================================================================
--- rt/3.8/trunk/share/html/Elements/EditCustomField	(original)
+++ rt/3.8/trunk/share/html/Elements/EditCustomField	Tue Dec 16 10:14:42 2008
@@ -59,7 +59,13 @@
     $Values = $Object->CustomFieldValues( $CustomField->id );
     $Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding SortOrder Creator Created LastUpdatedBy LastUpdated ) );
     $NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', '');
-} elsif (not $Default) {
+}
+
+# Don't take care of $Values if there isn't values inside
+undef ( $Values ) unless ( $Values->Count );
+
+# Always fill $Default with submited values if it's empty
+if ( not $Default ) {
     my %TOP = $m->request_args;
     $Default = $TOP{ $NamePrefix .$CustomField->Id . '-Values' }
             || $TOP{ $NamePrefix .$CustomField->Id . '-Value' };


More information about the Rt-commit mailing list