[Rt-commit] r4359 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Sun Dec 25 04:10:58 EST 2005


Author: ruz
Date: Sun Dec 25 03:20:16 2005
New Revision: 4359

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomField

Log:
 r1581 at cubic-pc:  cubic | 2005-12-25 11:23:40 +0300
  r1571 at cubic-pc:  cubic | 2005-12-25 11:13:58 +0300
  * move error path to the top
  * add warning
 


Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomField
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomField	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/EditCustomField	Sun Dec 25 03:20:16 2005
@@ -44,18 +44,23 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
+
+my $Type = $CustomField->Type;
+unless ( $Type ) {
+    # if we can't see the type, all hell will break loose.
+    $RT::Logger->warning( "Custom field #". $CustomField->id ." has empty type" );
+    return;
+}
+
 my $Values;
 if ($Object and $Object->id) {
     $Values = $Object->CustomFieldValues($CustomField->id);
     $Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding ) );
     $NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', '');
 }
-my $Type = $CustomField->Type;
-
-return unless ($Type); # if we can't see the type, all hell will break loose.
 
 my $MaxValues = $CustomField->MaxValues;
-if ($MaxValues == 1 and $Object and $Values) {
+if ($MaxValues == 1 && $Values) {
     # what exactly is this doing?  Without the "unless" it breaks RTFM
     # transaction extraction into articles.
     $Default = ($Values->First ? $Values->First->Content : '') unless $Default;


More information about the Rt-commit mailing list