Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
5.1
-
Server OS: Red Hat 6.4
PHP: 5.3.3
Database: MySQL 5.1.61
Browser: Any
Description
While testing the issue https://jira.ez.no/browse/EZP-20768 if you try to search a word on XML block you'll get the following error
RuntimeException: Database error /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php:61 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php:103 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/SearchService.php:90 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/SearchService.php:65 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:64 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:743 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:24 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:772 /var/www/apache2php53/ezp/ezpublish_testsystem/tests/toolkit/ezptestrunner.php:372
After a little debugging, adding an Exception $e to public function find( Criterion $criterion, $offset = 0, $limit = null, array $sort = null, array $translations = null ) function on vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php file I got a more specific error
1) eZPublishAPIEzp20768::testTC1593SearchingWithAPIUsingAFieldCriterionLeadsToAFatalError PDOException: 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 ') ) AND ezcontentobject_version.status = 1 )' at line 1 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:206 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:116 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php:53 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php:103 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/SearchService.php:90 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/SearchService.php:65 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:63 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:743 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:24 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:772 /var/www/apache2php53/ezp/ezpublish_testsystem/tests/toolkit/ezptestrunner.php:372
Steps:
Add a folder named "News"
Add an article with the name "foo" and the intro with "test"
Make the following search with the Public API
$criteria = array( new Criterion\ContentTypeIdentifier( 'article' ), new Criterion\Field( 'intro', '=', 'test' ) ); $query = new \eZ\Publish\API\Repository\Values\Content\Query( array( 'criterion' => new Criterion\LogicalAnd( $criteria ) ) ); $searchService = $this->repo->getSearchService(); $result = $searchService->findContent( $query ); echo( 'Found ' . $result->totalCount . ' items' ); foreach ( $result->searchHits as $searchHit ) { echo( $searchHit->valueObject->contentInfo->name ); }
Attachments
Issue Links
- blocks
-
EZP-20768 Searching with API using a Field criterion leads to a fatal error
- Closed