Re: Folderish + Behavior + NameChooser = oddness
"Jens W. Klein" <jens-/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Organization | Klein & Partner KG |
| Message-ID | <[email protected]> |
On 2015-03-19 11:22, Eric Bréhault wrote: >> Do we need to check for attributes? > > I guess it has been done originally for TAL expression (in your example: > what context/foo should return?) No idea. Both is wrong. I avoid TALES where possible: Not to debug, munges errors. But this is indeed a problem. Jens > Eric > > On Thu, Mar 19, 2015 at 10:43 AM, Jens W. Klein > <[email protected] > <mailto:[email protected]>> wrote: > > Hi, > > I just found an effect that needs at least documentation or further > discussion how to deal with it: > > Given you have a behavior defining a field `foo` and add this to a > folder and fill in the field `foo`. Now (by default) an attribute `foo` > is set on the folder. > > Now someone adds content (i.e. document) to the folder and name its > Title `Foo`. It tries to get the lowercased title as id (Default > NameChooser). > > This goes down to `OFS/ObjectManager.py(106)checkValidId()`. There is > also a check for Attributes, finds a `foo` already, so it is not allowed > and it falls back to `foo-1`. > > Now, for an average editor this does not make any sense. Because this > happend silently he looks for a document namend `foo` and there is no. > So he files a ticket in the projects tracker and bugs the developer. > > So happend at a customer of mine. > > And I'am sure this will happen again in future somewhere in the world in > a different project. > > Questions: > > - Do we need to check for attributes? > > - Why do we not make a clear difference between dict and attribute > access (so dict=contained, attributes=...well...attributes/data. > > - Can/Shall/Must we change this or is documentation of this oddness > enough? > > Jens > -- > Klein & Partner KG, member of BlueDynamics Alliance > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > by Intel and developed in partnership with Slashdot Media, is your > hub for all > things parallel software development, from weekly thought leadership > blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Plone-developers mailing list > [email protected] > <mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/plone-developers > > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > > > > _______________________________________________ > Plone-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/plone-developers > -- Klein & Partner KG, member of BlueDynamics Alliance ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Plone-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plone-developers