[Rt-commit] r2541 - rt/branches/3.4-RELEASE/html/Elements
tla at bestpractical.com
tla at bestpractical.com
Wed Mar 30 19:20:44 EST 2005
Author: tla
Date: Wed Mar 30 19:20:44 2005
New Revision: 2541
Modified:
rt/branches/3.4-RELEASE/html/Elements/EditCustomField
rt/branches/3.4-RELEASE/html/Elements/EditCustomFieldText
Log:
Fixes so that custom fields will pay attention to defaults, when the defaults
are specified.
Modified: rt/branches/3.4-RELEASE/html/Elements/EditCustomField
==============================================================================
--- rt/branches/3.4-RELEASE/html/Elements/EditCustomField (original)
+++ rt/branches/3.4-RELEASE/html/Elements/EditCustomField Wed Mar 30 19:20:44 2005
@@ -53,10 +53,11 @@
my $Type = $CustomField->Type;
my $MaxValues = $CustomField->MaxValues;
if ($MaxValues == 1 and $Object and $Values) {
- $Default = ($Values->First ? $Values->First->Content : '');
+ # what exactly is this doing? Without the "unless" it breaks RTFM
+ # transaction extraction into articles.
+ $Default = ($Values->First ? $Values->First->Content : '') unless $Default;
$Values->GotoFirstItem;
}
-
# The "Magic" hidden input causes RT to know that we were trying to edit the field, even if
# we don't see a value later, since browsers aren't compelled to submit empty form fields
$m->out("\n".'<input type="hidden" name="'.$NamePrefix.$CustomField->Id.'-Values-Magic" value="1">'."\n");
Modified: rt/branches/3.4-RELEASE/html/Elements/EditCustomFieldText
==============================================================================
--- rt/branches/3.4-RELEASE/html/Elements/EditCustomFieldText (original)
+++ rt/branches/3.4-RELEASE/html/Elements/EditCustomFieldText Wed Mar 30 19:20:44 2005
@@ -47,7 +47,7 @@
<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br>
% }
% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) {
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"></textarea>
+<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea>
% }
<%INIT>
# XXX - MultiValue textarea is for now outlawed.
More information about the Rt-commit
mailing list