Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot create listing for tags #861

Closed
gutentag2012 opened this issue May 6, 2024 · 5 comments
Closed

[Bug]: Cannot create listing for tags #861

gutentag2012 opened this issue May 6, 2024 · 5 comments
Assignees

Comments

@gutentag2012
Copy link

Expected behavior

When running a query and passing the tags: parameter, a list of all objects with that tag should be returned

Actual behavior

The following error is emitted:
"An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'o_id' in 'IN/ALL/ANY subquery'"

The following query is run:

SELECT object_localized_1_en.id as id, object_localized_1_en.type as `type` FROM object_localized_1_en WHERE (o_id IN (
                            SELECT cId FROM tags_assignment INNER JOIN tags ON tags.id = tags_assignment.tagid...

Ther it seems like the object_localized_1_en.id should have been named o_id for the query to work, but I am not completely sure.

Steps to reproduce

  1. Create a Pimcore Object
  2. Assign a Tag to the Object
  3. Create the GraphQL Schema
  4. Run a query for the Pimcore object via the getXXXListing with the tags: "YYY" argument
Copy link

Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

@mcop1 mcop1 self-assigned this Oct 23, 2024
@mcop1
Copy link
Contributor

mcop1 commented Oct 23, 2024

Hello @gutentag2012 ,

I couldn´t reproduce the problem. Could you please elaborate a bit? Which pimcore and data-hub version are using? How does your query look like exactly.

I tried a simple query for tags, e.g.
Image

@gutentag2012
Copy link
Author

gutentag2012 commented Oct 27, 2024

I tried it again now and this is what I get while using the following versions

  • pimcore/pimcore: v11.1.5
  • pimcore/data-hub: v1.6.5

Image

This error is then written to the logs

pimcore.EMERGENCY: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'o_id' in 'IN/ALL/ANY subquery' in /var/www/pimcore/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:71 
Stack trace:
 #0 /var/www/pimcore/vendor/doctrine/dbal/src/Driver/PDO/Connection.php(71): PDO->query()
 #1 /var/www/pimcore/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php(33): Doctrine\DBAL\Driver\PDO\Connection->query()
 #2 /var/www/pimcore/vendor/doctrine/dbal/src/Logging/Connection.php(43): Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware->query()
 #3 /var/www/pimcore/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php(33): Doctrine\DBAL\Logging\Connection->query()
 #4 /var/www/pimcore/vendor/symfony/doctrine-bridge/Middleware/Debug/DBAL3/Connection.php(58): Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware->query()
 #5 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(1101): Symfony\Bridge\Doctrine\Middleware\Debug\DBAL3\Connection->query()
 #6 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(953): Doctrine\DBAL\Connection->executeQuery()
 #7 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Dao.php(105): Doctrine\DBAL\Connection->fetchFirstColumn()
 #8 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Concrete/Dao.php(45): Pimcore\Model\DataObject\Listing\Dao->loadIdList()
 #9 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Dao.php(62): Pimcore\Model\DataObject\Listing\Concrete\Dao->loadIdList()
 #10 [internal function]: Pimcore\Model\DataObject\Listing\Dao->load()
 #11 /var/www/pimcore/vendor/pimcore/pimcore/lib/Model/AbstractModel.php(220): call_user_func_array()
 #12 /var/www/pimcore/vendor/pimcore/data-hub/src/GraphQL/Resolver/QueryType.php(367): Pimcore\Model\AbstractModel->__call()
 #13 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(714): Pimcore\Bundle\DataHubBundle\GraphQL\Resolver\QueryType->resolveEdges()
 #14 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(631): GraphQL\Executor\ReferenceExecutor->resolveFieldValueOrError()
 #15 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
 #16 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1256): GraphQL\Executor\ReferenceExecutor->executeFields()
 #17 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1210): GraphQL\Executor\ReferenceExecutor->collectAndExecuteSubfields()
 #18 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(893): GraphQL\Executor\ReferenceExecutor->completeObjectValue()
 #19 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(753): GraphQL\Executor\ReferenceExecutor->completeValue()
 #20 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(640): GraphQL\Executor\ReferenceExecutor->completeValueCatchingError()
 #21 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
 #22 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(298): GraphQL\Executor\ReferenceExecutor->executeFields()
 #23 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(237): GraphQL\Executor\ReferenceExecutor->executeOperation()
 #24 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/Executor.php(159): GraphQL\Executor\ReferenceExecutor->doExecute()
 #25 /var/www/pimcore/vendor/webonyx/graphql-php/src/GraphQL.php(162): GraphQL\Executor\Executor::promiseToExecute()
 #26 /var/www/pimcore/vendor/webonyx/graphql-php/src/GraphQL.php(96): GraphQL\GraphQL::promiseToExecute()
 #27 /var/www/pimcore/vendor/pimcore/data-hub/src/Controller/WebserviceController.php(203): GraphQL\GraphQL::executeQuery()
 #28 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(181): Pimcore\Bundle\DataHubBundle\Controller\WebserviceController->webonyxAction()
 #29 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
 #30 /var/www/pimcore/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle()
 #31 /var/www/pimcore/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle()
 #32 /var/www/pimcore/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
 #33 /var/www/pimcore/public/index.php(19): require_once('...')
 #34 {main}  Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'o_id' in 'IN/ALL/ANY subquery' in /var/www/pimcore/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28 Stack trace:
 #0 /var/www/pimcore/vendor/doctrine/dbal/src/Driver/PDO/Connection.php(76): Doctrine\DBAL\Driver\PDO\Exception::new()
 #1 /var/www/pimcore/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php(33): Doctrine\DBAL\Driver\PDO\Connection->query()
 #2 /var/www/pimcore/vendor/doctrine/dbal/src/Logging/Connection.php(43): Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware->query()
 #3 /var/www/pimcore/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php(33): Doctrine\DBAL\Logging\Connection->query()
 #4 /var/www/pimcore/vendor/symfony/doctrine-bridge/Middleware/Debug/DBAL3/Connection.php(58): Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware->query()
 #5 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(1101): Symfony\Bridge\Doctrine\Middleware\Debug\DBAL3\Connection->query()
 #6 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(953): Doctrine\DBAL\Connection->executeQuery()
 #7 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Dao.php(105): Doctrine\DBAL\Connection->fetchFirstColumn()
 #8 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Concrete/Dao.php(45): Pimcore\Model\DataObject\Listing\Dao->loadIdList()
 #9 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Dao.php(62): Pimcore\Model\DataObject\Listing\Concrete\Dao->loadIdList()
 #10 [internal function]: Pimcore\Model\DataObject\Listing\Dao->load()
 #11 /var/www/pimcore/vendor/pimcore/pimcore/lib/Model/AbstractModel.php(220): call_user_func_array()
 #12 /var/www/pimcore/vendor/pimcore/data-hub/src/GraphQL/Resolver/QueryType.php(367): Pimcore\Model\AbstractModel->__call()
 #13 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(714): Pimcore\Bundle\DataHubBundle\GraphQL\Resolver\QueryType->resolveEdges()
 #14 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(631): GraphQL\Executor\ReferenceExecutor->resolveFieldValueOrError()
 #15 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
 #16 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1256): GraphQL\Executor\ReferenceExecutor->executeFields()
 #17 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1210): GraphQL\Executor\ReferenceExecutor->collectAndExecuteSubfields()
 #18 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(893): GraphQL\Executor\ReferenceExecutor->completeObjectValue()
 #19 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(753): GraphQL\Executor\ReferenceExecutor->completeValue()
 #20 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(640): GraphQL\Executor\ReferenceExecutor->completeValueCatchingError()
 #21 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
 #22 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(298): GraphQL\Executor\ReferenceExecutor->executeFields()
 #23 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(237): GraphQL\Executor\ReferenceExecutor->executeOperation()
 #24 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/Executor.php(159): GraphQL\Executor\ReferenceExecutor->doExecute()
 #25 /var/www/pimcore/vendor/webonyx/graphql-php/src/GraphQL.php(162): GraphQL\Executor\Executor::promiseToExecute()
 #26 /var/www/pimcore/vendor/webonyx/graphql-php/src/GraphQL.php(96): GraphQL\GraphQL::promiseToExecute()
 #27 /var/www/pimcore/vendor/pimcore/data-hub/src/Controller/WebserviceController.php(203): GraphQL\GraphQL::executeQuery()
 #28 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(181): Pimcore\Bundle\DataHubBundle\Controller\WebserviceController->webonyxAction()
 #29 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
 #30 /var/www/pimcore/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle()
 #31 /var/www/pimcore/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle()
 #32 /var/www/pimcore/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
 #33 /var/www/pimcore/public/index.php(19): require_once('...')
 #34 {main}  Next Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'o_id' in 'IN/ALL/ANY subquery' in /var/www/pimcore/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67 Stack trace:
 #0 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(1943): Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
 #1 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(1885): Doctrine\DBAL\Connection->handleDriverException()
 #2 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(1106): Doctrine\DBAL\Connection->convertExceptionDuringQuery()
 #3 /var/www/pimcore/vendor/doctrine/dbal/src/Connection.php(953): Doctrine\DBAL\Connection->executeQuery()
 #4 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Dao.php(105): Doctrine\DBAL\Connection->fetchFirstColumn()
 #5 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Concrete/Dao.php(45): Pimcore\Model\DataObject\Listing\Dao->loadIdList()
 #6 /var/www/pimcore/vendor/pimcore/pimcore/models/DataObject/Listing/Dao.php(62): Pimcore\Model\DataObject\Listing\Concrete\Dao->loadIdList()
 #7 [internal function]: Pimcore\Model\DataObject\Listing\Dao->load()
 #8 /var/www/pimcore/vendor/pimcore/pimcore/lib/Model/AbstractModel.php(220): call_user_func_array()
 #9 /var/www/pimcore/vendor/pimcore/data-hub/src/GraphQL/Resolver/QueryType.php(367): Pimcore\Model\AbstractModel->__call()
 #10 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(714): Pimcore\Bundle\DataHubBundle\GraphQL\Resolver\QueryType->resolveEdges()
 #11 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(631): GraphQL\Executor\ReferenceExecutor->resolveFieldValueOrError()
 #12 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
 #13 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1256): GraphQL\Executor\ReferenceExecutor->executeFields()
 #14 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1210): GraphQL\Executor\ReferenceExecutor->collectAndExecuteSubfields()
 #15 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(893): GraphQL\Executor\ReferenceExecutor->completeObjectValue()
 #16 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(753): GraphQL\Executor\ReferenceExecutor->completeValue()
 #17 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(640): GraphQL\Executor\ReferenceExecutor->completeValueCatchingError()
 #18 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
 #19 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(298): GraphQL\Executor\ReferenceExecutor->executeFields()
 #20 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(237): GraphQL\Executor\ReferenceExecutor->executeOperation()
 #21 /var/www/pimcore/vendor/webonyx/graphql-php/src/Executor/Executor.php(159): GraphQL\Executor\ReferenceExecutor->doExecute()
 #22 /var/www/pimcore/vendor/webonyx/graphql-php/src/GraphQL.php(162): GraphQL\Executor\Executor::promiseToExecute()
 #23 /var/www/pimcore/vendor/webonyx/graphql-php/src/GraphQL.php(96): GraphQL\GraphQL::promiseToExecute()
 #24 /var/www/pimcore/vendor/pimcore/data-hub/src/Controller/WebserviceController.php(203): GraphQL\GraphQL::executeQuery()
 #25 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(181): Pimcore\Bundle\DataHubBundle\Controller\WebserviceController->webonyxAction()
 #26 /var/www/pimcore/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
 #27 /var/www/pimcore/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle()
 #28 /var/www/pimcore/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle()
 #29 /var/www/pimcore/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
 #30 /var/www/pimcore/public/index.php(19): require_once('...')
 #31 {main} [] []

@blankse
Copy link
Contributor

blankse commented Oct 28, 2024

@gutentag2012 Is fixed in data-hub version 1.6.6. See: #833
So you have to update.

@gutentag2012
Copy link
Author

Ah okay thank you, perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants