[Product-Developers] Products.ZCatalog A different document already exists in the index.

Roijen, Bas bas.roijen at cofely-gdfsuez.nl
Fri Dec 23 12:22:00 UTC 2011


Isn't template stuff also called multiple times?
Test if the folder already exists before creating it.
Should be something like this:

if not self['admin']:
    self.invokeFactory('Folder', 'admin', title=_(u"Admin"))

and so on.

Kind regards,

Bas Roijen

________________________________________
Van: plone-product-developers-bounces at lists.plone.org [plone-product-developers-bounces at lists.plone.org] namens Maarten Nieber [maarten at usecm.com]
Verzonden: vrijdag 23 december 2011 12:57
Aan: plone-product-developers at lists.plone.org
Onderwerp: [Product-Developers] Products.ZCatalog A different document already  exists in the index.

Hi,

I'm having problems with this error

2011-12-23 12:49:32 ERROR Products.ZCatalog A different document with value
'f5c72602-989d-4939-a9a2-12ee81bab10f' already exists in the index.'

I thought it was related to dexterity, since there was a bug report in Plone
about this which mentioned something about ids are created in dexterity.
If I ignore this error, I get crashes later on in the folder_contents view, so
that's not an option.

I switched to archetypes, but I'm getting the same error. The error occurs when
Below I'm pasting the code for my function that generates the warning (I call
this function when my template is rendered, because if I use the
IObjectAddedEvent, the function gets called 5 times).

Any ideas where this error comes from?

Thanks!
Maarten

    def createElMolinoSubFolders(self):
        """
        Helper that finishes the construction by creating several member
        variables (this code does not work when called from the constructor).
        """

        self.invokeFactory(
            'Folder',
            'admin',
            title=_(u"Admin")
        )
        self.adminFolder = self['admin']
        self.adminFolder.reindexObject()

        self.adminFolder.invokeFactory(
            'ShowsFolder',
            'shows',
            title=_(u"Shows")
        )
        self.shows = self.adminFolder['shows']

        self.adminFolder.invokeFactory(
            'Folder',
            'artists',
            title=_(u"Artists")
        )
        artistsFolder = self.adminFolder['artists']
        artistsFolder.reindexObject()

        artistsFolder.invokeFactory(
            'ArtistsFolder',
            'current_artists',
            title=_(u"Current Artists")
        )
        self.currentArtists = artistsFolder['current_artists']
        self.currentArtists.reindexObject()

        artistsFolder.invokeFactory(
            'ArtistsFolder',
            'ens_han_visitat',
            title=_(u"Ens han visitat")
        )
        self.currentArtistsEnsHanVisitat = artistsFolder['ens_han_visitat']
        self.currentArtistsEnsHanVisitat.reindexObject()

        artistsFolder.invokeFactory(
            'ArtistsFolder',
            'past_artists',
            title=_(u"Past Artists")
        )
        self.pastArtists = artistsFolder['past_artists']
        self.pastArtists.reindexObject()

        self.reindexObject()




_______________________________________________
Product-Developers mailing list
Product-Developers at lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers

================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht
onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en
de afzender direct te informeren door het bericht te retourneren.
================================================
The information contained in this message may be confidential
and is intended to be exclusively for the addressee. Should you
receive this message unintentionally, please do not use the contents
herein and notify the sender immediately by return e-mail.
================================================


More information about the Product-Developers mailing list