Closed harmstyler closed 8 years ago
Fixes issue #2
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.
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.
Thanks @harmstyler !
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 theaddObject
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.