[Maypole] addnew grabbing search_form parameters
Dave Howorth
dhoworth@mrc-lmb.cam.ac.uk
Tue, 25 Jan 2005 15:03:39 +0000
Simon Flack wrote:
> I think we need something like:
> [% IF request.action = 'do_edit' %] ... [% END %]
>
> ...surrounding the manipulation of the cloned 'classmetadata.cgi.$col'
Yep. This fixes it for me ...
--- templates/factory/addnew Sun Jan 16 18:28:16 2005
+++ /var/www/beerdb_sav/factory/addnew Tue Jan 25 14:58:14 2005
@@ -20,10 +20,12 @@
[%
SET elem = classmetadata.cgi.$col.clone;
- IF elem.tag == "textarea";
- elem = elem.push_content(request.param(col));
- ELSE;
- elem.attr("value", request.param(col));
+ IF request.action == 'do_edit' ;
+ IF elem.tag == "textarea";
+ elem = elem.push_content(request.param(col));
+ ELSE;
+ elem.attr("value", request.param(col));
+ END;
END;
elem.as_XML; %]
Cheers, Dave