[interchange-cvs] interchange - jon modified code/UI_Tag/table_editor.coretag
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Mon May 6 15:36:01 2002
User: jon
Date: 2002-05-06 19:34:39 GMT
Modified: code/UI_Tag table_editor.coretag
Log:
Fix bug in profile handling of table editor that kept '$' in profiles from
working right ($Values->{whatever} and so on).
Also tolerate profiles that don't end in a newline (e.g. when quoted
with |...| in the table-editor tag).
Revision Changes Path
1.5 +8 -4 interchange/code/UI_Tag/table_editor.coretag
rev 1.5, prev_rev 1.4
Index: table_editor.coretag
===================================================================
RCS file: /var/cvs/interchange/code/UI_Tag/table_editor.coretag,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- table_editor.coretag 20 Mar 2002 23:13:26 -0000 1.4
+++ table_editor.coretag 6 May 2002 19:34:39 -0000 1.5
@@ -427,11 +427,13 @@
$error_show_var = 0 if $v =~ /\S /;
}
}
- $prof = '&calc delete \\$Values->{step_' . $name . "}\n" . $prof;
+ $prof = '&calc delete $Values->{step_' . $name . "}\n" . $prof;
$opt->{ui_profile_success} = "&set=step_$name 1";
}
}
my $success = $opt->{ui_profile_success};
+ # make sure profile so far ends with a newline so we can add more
+ $prof .= "\n" unless $prof =~ /\n\s*\z/;
if(ref $check) {
while ( my($k, $v) = each %$check ) {
$error->{$k} = 1;
@@ -457,12 +459,13 @@
$opt->{hidden} = {} if ! $opt->{hidden};
$opt->{hidden}{mv_form_profile} = 'ui_profile';
my $fail = $opt->{mv_failpage} || $Global::Variable->{MV_PAGE};
+
+ # watch out for early interpolation here!
$Scratch->{ui_profile} = <<EOF;
[perl]
#Debug("cancel='$opt->{orig_cancel_text}' back='$opt->{orig_back_text}' click=\$CGI->{mv_click}");
my \@clicks = split /\\0/, \$CGI->{mv_click};
- my \$fail = '$fail';
for( qq{$opt->{orig_cancel_text}}, qq{$opt->{orig_back_text}}) {
#Debug("compare is '\$_'");
next unless \$_;
@@ -472,8 +475,9 @@
return if \$_ eq \$cancel;
}
}
-
- return <<EOP;
+ # the following should already be interpolated by the table-editor tag
+ # before going into scratch ui_profile
+ return <<'EOP';
$prof
&fail=$fail
&fatal=1