Question

I am querying portal_catalog to populate a vocabulary with (UID, Title) tuples. The site has both Archetypes and Dexterity content.

brains = portal_catalog.searchResults(path={ "query": site_physical_path + "/" + folder_name },
               portal_type=["foobar.app.courseinfo", "Folder"] )

Look like Dexterity content is not given proper UID and in fact all Dexterity items have the same UID (it's not even an invalid value).

 ('29550a9a-5e6c-4593-8bee-9db11f29b934', u'xxx dexterity'), ('29550a9a-5e6c-4593-8bee-9db11f29b934', u'yyy dexterity'),

What's the best strategy to have unique ids across both Archetypes and Dexterity content in portal_catalog to be used as a look-up-able content id key?

Was it helpful?

Solution

It's probably acquiring the UID from the container of the Dexterity items.

As of Dexterity 1.1, all Dexterity items should get their own UUID as long as plone.uuid is present, which should always be the case in Plone 4.1 and above. Make sure you run the upgrade step to add UUIDs to existing items that don't have them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top