netgen / ezplatformsearch

eZ Platform Search is an eZ Publish legacy extension that integrates eZ Platform search capabilities into eZ Publish legacy
https://netgen.io
GNU General Public License v2.0
10 stars 5 forks source link

Content Copy triggers unhandled error #2

Closed harmstyler closed 8 years ago

harmstyler commented 8 years ago

When copying content in the admin, the function addObject() fails. It looks like this is because eZ, in the legacy kernel, triggers the addObject() before the new location has been committed to the database. The eZPlatformSearch plugin seems to require that objects exist in the database in order for the addObject function to work (https://github.com/netgen/ezplatformsearch/blob/master/search/plugins/ezplatformsearch/ezplatformsearch.php#L80).

harmstyler commented 8 years ago

I am unable to find a converter that doesn't rely on the object already being in the database, otherwise I would submit a PR.

emodric commented 8 years ago

Are we talking about location or content? Because you wrote:

before the new location has been committed to the database

In either case, we can catch the NotFoundException and return if no content is found. But then what to do in these cases? Leave the object unindexed?

harmstyler commented 8 years ago

Sorry, yes, a content object. I am in favor of catching the NotFoundException. In that case then could we create a new pending action to make sure the new content does eventually make it to the index?

Its not perfect. The the new page will not be accessible on the frontend siteaccesses for a few minutes if the site is using the search repository to serve the site, but it seems to be a good compromise to avoid submitting a patch upstream to the legacy kernel.

emodric commented 8 years ago

I'm up for it too. Pending action sounds reasonable :)

emodric commented 8 years ago

Closed by #4