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

Exception when publishing content using ezmultiupload #15

Closed punknroll closed 6 years ago

punknroll commented 6 years ago

Hi, when I create content in the legacy backend using multiupload the new contents are missing in the search index. Those entries are added to the ezpending_actions table because an exception appears:

Could not find 'location' with identifier '3481335'

https://github.com/netgen/ezplatformsearch/blob/master/search/plugins/ezplatformsearch/ezplatformsearch.php#L101

After running the indexcontent cronjob the contentobjects are inside the index again.

ezplatform 2.0 ezpublish-legacy v2017.12.1.1 ezplatformsearch 1.2.2 greetz

emodric commented 6 years ago

@punknroll Hi! Thank for your bug report!

Where do you get the exception? As you can see in the code, the exception is caught and acted upon, so it shouldn't appear anywhere. Can you post the stack trace of the exception you get?

Adding the new pending action is expected if indexing the content added through eZ Multiupload is done inside eZ Publish legacy transaction, because new kernel cannot yet see the content. As per docs, you should setup the legacy cronjob to be ran every couple of minutes to remedy this: https://github.com/netgen/ezplatformsearch/blob/master/README.md#setup-cronjobs

punknroll commented 6 years ago

@emodric Hi, Thank you for your quick reply!

You are right. The exception is caught and doesn't appear anywhere. Regarding your explanation the code works as expected and the index for those objectes created by the multiupload is generated by the indexcontent cronjob. I overlooked that part in the docs. Sorry for that.