[ZCM] [ZC] 612/ 8 Resolve "Can't add a "multiple selection"-property"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Thu, 02 Jan 2003 05:43:49 -0500


Issue #612 Update (Resolve) "Can't add a "multiple selection"-property"
 Status Resolved, Zope/bug critical
To followup, visit:
  http://collector.zope.org/Zope/612

==============================================================
= Resolve - Entry #8 by chrisw on Jan 2, 2003 5:43 am

 Status: Accepted => Resolved

Agreed. I've been trying to find the original bug report which I miss-fixed but have come up with nothing :-S

I'll close this issue and re-open one then next time I encounter the problem.
________________________________________
= Comment - Entry #7 by mjablonski on Dec 21, 2002 8:57 am

The reported bug [entry 1] is fixed. So IMHO the whole issue should be closed.

Chris, if you found another bug, you should fill out a new collector issue. This way things will be kept much clearer [one collector-issue per bug] and your report will be get more attention... :)
________________________________________
= Comment - Entry #6 by chrisw on Dec 21, 2002 4:29 am

I don't see anything that describes this bug as fixed. 
I implemented an initial fix which was incorrect.
I'm still waiting on a response from Brian.
________________________________________
= Comment - Entry #5 by mjablonski on Dec 20, 2002 7:03 pm

The described bug was fixed so I would suggest to close this issue.
________________________________________
= Comment - Entry #4 by chrisw on Oct 16, 2002 6:57 am

TypesTool.py define a property of type information objects as:
        {'id':'allowed_content_types'
         , 'type': 'multiple selection'
         , 'mode':'w'
         , 'label':'Allowed content types'
         , 'select_variable':'listContentTypes'
         },

Now listContentTypes is a method that can return an empty list.
What happens when the thing specified in the select_variable returns an empty list?

I suspect I unearthed a bug but fixed it in the wrong place...

Ideas?

Chris
________________________________________
= Accept - Entry #3 by Brian on Oct 14, 2002 11:06 am

 Status: Pending => Accepted

 Supporters added: Brian

Chris - I've had to back out your change for 2.6 b2, as it 
broke all ability to add multiple select properties. I don't 
know the details of the CMF bug you are referring to, but I 
don't believe the *value* of a multiple select property as 
it comes in in a request should ever be a sequence - it should 
always be a string referring to the existing property from 
which to draw the values of the multiple select.

Your change made it so that the value was always converted to 
a 1-item list, which is what broke things.

I don't know the right answer for the CMF issue, but the 
value of the multiple select needs to remain a string to 
work properly.

-Brian
________________________________________
= Comment - Entry #2 by chrisw on Oct 11, 2002 6:45 am

Arg. I added that line to solve a problem with empty multiple selection lists on CMF TypeInfo objects' Properties pages.

I'm not gonna 'accept' this, 'cos I don't know what's going on, btu I just wanted to note that the line in question was added for a verygood reason, so please don't delete it without finding out what's really going on...

________________________________________
= Request - Entry #1 by mjablonski on Oct 10, 2002 8:49 pm

Add a lines-property with name='foo'. Then adding a "multiple selection"-property with name='foobar' and value='foo' results in an error: 

Error Type: Bad Request
Error Value: No select variable ['reference']

If I comment out line 160 of ZPublisher/Converters.py

#    'multiple selection': field2lines,

all works fine. Interesting note: There's no entry for 'selection' in the type_converters, so they work without problems...

type_converters = {
    'float':              field2float,
    'int':                field2int,
    'long':               field2long,
    'string':             field2string,
    'date':               field2date,
    'required':           field2required,
    'tokens':             field2tokens,
    'lines':              field2lines,
    'text':               field2text,
    'boolean':            field2boolean,
    'multiple selection': field2lines,
    'ustring':            field2ustring,
    'utokens':            field2utokens,
    'ulines':             field2ulines,
    'utext':              field2utext,
    }

cheers, maik

==============================================================