First 2010 Plone aha-erlebnis: Ordering objects in folders with multilingual sites

For some time I have been plagued with random ordering hickups in Plone. Say you have  a Plone site with 4 folders and you’d like to move the last folder in the folder_contents to the top so that it also appears first in the main portal_tabs. Normal procedure: you drag the item to the top of the site by ‘pulling’ on the two ‘::’ colons at the end.  It seems to work at first but there’s some sneaky AJAX going on in the background. If you reload the page your folder is still where it was.ordering-plone

You do it again with a reload. Nothing. You do it again. It moves up one spot. That’s not good enough… If you disable javascript in your browser you will see two arrows, this is the plain HTML fallback. it calls an url on the folder that ends with ‘mainfolder/folder_position?position=up&id=site-content’ to move the object up in the folder. But what’s going on with this non deterministic ordering?

ordering-arrows

My colleague Maurits van Rees had an interesting theory that seems plausible enough for me at the moment: in all the sites I have experienced thes ordering problems there’s LinguaPlone installed because the site is multilingual. And one of the tricks LinguaPlone has up it’s sleeves is that it will filter out all objects in folder listings and navigation that are in a different language than the language you’re viewing the site in.  So what is happening when you move an object one position up in a Dutch/English site where there are not 4, but actually 8 folders in the Plone site root? Nothing. Only after moving up 5 times you will notice any difference, because you have to pass 4 ‘hidden’ Dutch folders first if you are trying to re-order the English objects.

ordering

When using drag and drop the javascript involved is a bit more intelligent and tries to move the object for example 4 positions if you drag it 4 places above. But as you can see that doesn’t help in this case. Imagine how many times you have to move an item when there are 5 or 6 translations in a site, each with 5 folders in the main site root.

I’ve seen this happening in several Plone 3 sites with LinguaPlone 2.2/2.4 Hard to tell what/who is to blame or how to fix this, but it’s annoying at least.


Comments are closed.