Die Webmeister haben ein neues Vereinsheim unter webmeisterei.com. Unsere alte Seite bleibt auf unbestimmte Zeit unter archiv.webmeisterei.com erreichbar.

meta_types containing spaces break folder_contents sorting

If you experience problems with sorting/reordering items in folder_contents as i did recently
this might save you from spending > 2 hrs with debugging.

If your folder does contain custom or third party content types that have a space ” ” in their meta_type (see portal_type/ ‘Product meta type’) you most probably ran into the same problem:

If you defined the meta_type of your content type in profiles/default/types/My_Type.xml like that:

<object name="My Type">
  ...
  <property name="content_meta_type">My Type</property>
  ...

objects of your type will have ‘MyType’ as meta_type:

>>> _ = folder.invokeFactory('My Type', 'mytype')
>>> folder.mytype.meta_type
'MyType'

Products.Archetypes.OrderedBaseFolder.moveObjectsByDelta only takes CMF-Types into account.

This is done by using only those ids returned by getCMFObjectsSubsetIds which lists all meta_types registered in portal_types and compares them to the meta_type of the objects contained in the folder.

Since these differ for meta types containing spaces you’ll experience very strange behaviour when reordering items in a folder containing some objects of type ‘My Type’.

Solution:

In case you’re responsible for the product, simply change the GS profile for the portal type from <property name="content_meta_type">My Type</property> to <property name="content_meta_type">MyType</property> and reinstall the product.

In case you’re using a third party product you’re out of luck.
This is why I filed a bug (https://dev.plone.org/plone/ticket/8161)

.installed.cfg can be evil

rm .installed.cfg

In case you experience strange VersionConflicts on your buildout, this might save you some time:

Today i wanted to update a plone3.0 buildout to plone3.1-rc1,
since i needed static portlets in a project and plone.portlet.static does not work on plone3.0 (see http://plone.org/documentation/how-to/creating-static-text-portlets-in-plone-3.0)

I changed the version numbers in the plone recipe:

[plone]
#recipe = plone.recipe.plone>=3.0,<3.1dev
recipe = plone.recipe.plone >=3.1rc1, < 3.2dev

Changing the version number in a fresh buildout worked out fine, but when running bin/buildout on my existing project i got a version conflict:


VersionConflict:
(plone.recipe.plone 3.1-rc1 (.../plone.recipe.plone-3.1_rc1-py2.4.egg), Requirement.parse('plone.recipe.plone>=3.0,<3.1dev'))

The root of all evli was .installed.cfg in my case. This file contains the dependend eggs and their versions.
In a plone3.0 buildout you can find the following line in .installed.cfg:

recipe = plone.recipe.plone>=3.0,<3.1dev

Solution

delete .installed.cfg and run your buildout again.



Update: This is a bug and might be fixed soon.