Skip to content

DocumentTypeAdapter getRelatedItemsOnUpdateQuery return empty query #231

@morgannilsson

Description

@morgannilsson

Suggested solution:

Instead of empty query it should return null.

Description:

pimcore/vendor/pimcore/generic-data-index-bundle/src/Service/SearchIndex/IndexService/ElementTypeAdapter/DocumentTypeAdapter.php has been added since v1.0.5 of generic-data-index-bundle.

The getRelatedItemsOnUpdateQuery method return a QueryBuilder that breaks the enqueueRelatedItemsOnUpdate method in pimcore/vendor/pimcore/generic-data-index-bundle/src/Service/SearchIndex/IndexQueue/EnqueueService.php

Changing the getRelatedItemsOnUpdateQuery method to return null eliminates the error logs and behaves more like v1.0.5.

Steps to reproduce:

  • Create a headless document.

Result:

ERROR [pimcore] Update indexQueue in database-table generic_data_index_queue failed! Error: An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON DUPLICATE KEY
UPDATE
operation = VALUES(operation),
' at line 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions