[Zope-CMF] Bug: 'TypeError: cannot convert string to
tuple' in metadata_edit
Grégoire Weber
gregoire.weber@switzerland.org
Sat, 14 Jul 2001 01:57:35 +0200
Hi Seb,
> > When I call metadata_edit directly from the browser with a
> > parameter which is internaly represented by a tuple like
> > 'contributors' or subject I get a error, if the parameter
> > occurs once only:
> > http://path/to/obj/metadata_edit?contributors=x
>
> This is what the type coercion rules are for:
>
> http://path/to/obj/metadata_edit?contributors:list=x
You're right. This works!
And http://path/to/obj/metadata_edit?contributors:lines=x also.
> Your patch is a more robust way of dealing with this kind of
> thing, though. I wonder where the responsibility for ensuring type
> correctness should lie?
That's a good question! I don't see the implications in depth!
The question is: Are these types real types describing the datas
structure or the datas presentation (in HTML)?
Consider this (original code snippet out of metadata_edit_form):
<textarea name="subject:lines" rows="3"
^--------------------------- this!
cols="20"><dtml-in Subject
><dtml-let item=sequence-item
><dtml-unless expr="item in allowedSubjects"
><dtml-var sequence-item>
</dtml-unless></dtml-let></dtml-in></textarea>
<dtml-comment>
Comment out / delete this to ignore controlled vocabulary
for Subject.
</dtml-comment>
<br>
<select name="subject:list" multiple>
^------------------------------ and this!
<dtml-in allowedSubjects>
<dtml-let item=sequence-item
sel="item in contentSubject and 'selected' or ''">
<option value="&dtml-sequence-item;"
&dtml-sel;> &dtml-sequence-item; </option>
</dtml-let>
</dtml-in>
</select>
The question which arrises (for me):
Is subject of type lines or of type list? Hmmm!
I had some problems a few days ago when I customized
metadata_edit_form by puting the <select ...> block before the
<textarea ...> block! Perhaps its the same source of problems.
Greg
_____________________________________
Grégoire Weber
mailto:gregoire.weber@switzerland.org