ZF-10370: Wrong parameters for Exception in QueryParserContext

Issue Type: Bug Created: 2010-08-23T09:29:29.000+0000 Last Updated: 2011-04-28T15:24:06.000+0000 Status: Open Fix version(s): Reporter: Yitzchak Schaffer (yitznewton) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

Related issues: - ZF-8547



Client code is $query = Zend_Search_Lucene_Search_QueryParser::parse( $querystring );

When $querystring begins with a Boolean keyword, such as or foo, the following error is encountered: {quote}Fatal error: Wrong parameters for Exception([string $exception [, long $code ]]) in /www/websites/emeraldview-tip/modules/emeraldview/vendors/Zend/Search/Lucene/Search/QueryParserContext.php on line 330{quote}

Not sure if it's this simple, but here's a patch:

<pre class="highlight">
Index: Search/QueryParserContext.php
--- Search/QueryParserContext.php       (revision 22886)
+++ Search/QueryParserContext.php       (working copy)
@@ -327,7 +327,7 @@
             //                                                          $e->getMessage() . '\'.' );
             // It's query syntax error message and it should be user friendly. So FSM message is omitted
             require_once 'Zend/Search/Lucene/Search/QueryParserException.php';
-            throw new Zend_Search_Lucene_Search_QueryParserException('Boolean expression error.', 0, $e);
+            throw new Zend_Search_Lucene_Search_QueryParserException('Boolean expression error.', 0);

         // Remove 'only negative' conjunctions


Posted by Satoru Yoshida (satoruyoshida) on 2011-04-28T15:24:06.000+0000

It seems to be caused from ZF-8547. Q1) Do you use PHP 5.3 ? Q2) Does Zend_Exception::__construct() have 3 parameters in your environment?

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.