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

Add content/copy support to eZPlatformSearch #4

Closed harmstyler closed 8 years ago

harmstyler commented 8 years ago

This change modifies the addObject function to test if the content object being added to the solr index is available in the database before continuing. The legacy module content/copy triggers the addObject function before the new content is actually in the database, causing an uncaught exception in the search plugin. The try/catch approach seems best because the function is not sent any information about how the $contentObject was created. The copied content is then added at a later time by a frequent cronjob.

harmstyler commented 8 years ago

Fixes issue #2

emodric commented 8 years ago

This PR has a conflict now that #3 is merged :)

Is there really a need for separate cron script here too? Because you can use already existing ezpublish_legacy/cronjobs/indexcontent.php. You just need to use index_object pending action.

harmstyler commented 8 years ago

I fixed the merge conflict and removed the redundant cron job. I didn't know about the indexcontent cronjob already existing :). I also updated the catch to use the base not found exception.

emodric commented 8 years ago

Thanks @harmstyler !