Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Simple Search form shows no results / show error on (2nd) Second Language

Status Resolved
Add-on / Version Publisher publisher 3.1.1 build 33083864
Severity
EE Version 5.2.2

Mephics (T) Ltd

Feb 14, 2020

This my Search Form TAGS

{exp:search:simple_form form_class="navbar-form navbar-right" result_page="search" search_in="everywhere" limit="20" paginate="bottom"}
<input type="text" id="search" name="keywords" placeholder="{phrase:search}">
<button type="submit" id="search-submit"><i class="fa fa-search"></i></button>
{/exp:search:simple_form}

This is The Search results Page TAGS
————————————————————————

<h1><span> {exp:search:total_results}{total}{/exp:search:total_results} Search Results for "<strong>{exp:search:keywords}</strong>"</span></h1>
<p>                                      </p><div id="listsearch">
<p>    </p><ol>
    {exp:search:search_results}

    {exp:search_marker}
    	<li><p><a href="{if page_url != ''}{page_url}{if:else}{auto_path}{/if}"><strong>{title}</strong></a><br / > {excerpt}</p>
</li>
<p>    {/exp:search_marker}<br />
                        <br />
    <!-- Pagination --><br />
    {paginate}{pagination_links}<br />
    </p><ul class="page-numbers">
        {page}<li><a class="page-numbers {if current_page}current{/if}" href="{pagination_url}">{pagination_page_number}</a></li> {/page}
    </ul><p>{/pagination_links}{/paginate}<br />
    <!-- End Pagination -->  <br />
                            <br />
    {/exp:search:search_results}<br />
    </p>
</ol>
</div>

THIS SEARCH RESULTS
—————————————————-
Exception Caught
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 ‘,,,,,,,) ORDER BY t.entry_date desc’ at line 4:
SELECT COUNT(*) AS count FROM exp_channel_titles AS t LEFT JOIN exp_channels AS w ON t.channel_id = w.channel_id LEFT JOIN exp_channel_data AS wd ON t.entry_id = wd.entry_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id WHERE t.entry_id IN (,,,,,,,,) ORDER BY t.entry_date desc
ee/legacy/database/drivers/mysqli/mysqli_connection.php:117

Stack Trace: Please include when reporting this error
#0 admin\ee\legacy\database\drivers\mysqli\mysqli_driver.php(112): CI_DB_mysqli_connection->query(‘SELECT COUNT(*)...’)
#1 admin\ee\legacy\database\DB_driver.php(270): CI_DB_mysqli_driver->_execute(‘SELECT COUNT(*)...’)
#2 admin\ee\legacy\database\DB_driver.php(180): CI_DB_driver->simple_query(‘SELECT COUNT(*)...’)
#3 admin\user\addons\publisher\legacy\libraries\Publisher_search.php(279): CI_DB_driver->query(‘SELECT COUNT(*)...’)
#4 admin\user\addons\publisher\ext.publisher.php(990): Publisher_search->modify_result_query(‘SELECT DISTINCT…’, ‘1672312d755728b…’)
#5 admin\ee\legacy\libraries\Extensions.php(222): Publisher_ext->channel_search_modify_result_query(‘SELECT DISTINCT…’, ‘1672312d755728b…’)
#6 admin\ee\legacy\libraries\Extensions.php(117): EE_Extensions->call_class(‘Publisher_ext’, ‘channel_search_…’, Array, Array)
#7 admin\ee\EllisLab\Addons\search\mod.search.php(1310): EE_Extensions->call(‘channel_search_…’, ‘SELECT DISTINCT…’, ‘1672312d755728b…’)
#8 admin\ee\legacy\libraries\Template.php(1847): Search->search_results()
#9 admin\ee\legacy\libraries\Template.php(1482): EE_Template->process_tags()
#10 admin\ee\legacy\libraries\Template.php(578): EE_Template->tags()
#11 admin\ee\legacy\libraries\Template.php(234): EE_Template->parse(’{!—ra:0000000…’, false, 1, false)
#12 admin\ee\legacy\libraries\Template.php(165): EE_Template->fetch_and_parse(‘search’, Array, false)
#13 admin\ee\legacy\libraries\Core.php(661): EE_Template->run_template_engine(‘search’, ‘index’)
#14 admin\ee\legacy\controllers\ee.php(63): EE_Core->generate_page()
#15 [internal function]: EE->index()
#16 admin\ee\EllisLab\ExpressionEngine\Core\Core.php(241): call_user_func_array(Array, Array)
#17 admin\ee\EllisLab\ExpressionEngine\Core\Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#18 admin\ee\EllisLab\ExpressionEngine\Boot\boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#19 index.php(173): require_once(‘D:\\www\\wamp64\\w…’)
#19 index.php(173): require_once(‘D:\\www\\wamp64\\w…’)

#1

BoldMinded (Brian)

Comment has been marked private.

#2

Mephics (T) Ltd

I have also cleared cache and installation given but still gives the same errors on the second language results…

#3

BoldMinded (Brian)

Try clearing everything from your search_log table. I was able to replicate the issue as you reported it in a non-default language, and my changes definitely fixed the issue for me.

#4

Mephics (T) Ltd

It now gives this error

Exception Caught There was a database connection error or a problem with a query. Log in as a super admin or enable debugging for more information.

ee/legacy/database/drivers/mysqli/mysqli_connection.php:117

#5

BoldMinded (Brian)

I can’t do anything unless I know what the error was. Did you check your logs?

#6

Mephics (T) Ltd

After a few test i found out that the build given works!, however it gives the same ERROR (as below) if it finds there is no single translated entry in the db!,


Exception Caught 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 ‘) ORDER BY t.entry_date desc’ at line 4: SELECT COUNT(*) AS count FROM exp_channel_titles AS t LEFT JOIN exp_channels AS w ON t.channel_id = w.channel_id LEFT JOIN exp_channel_data AS wd ON t.entry_id = wd.entry_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id WHERE t.entry_id IN () ORDER BY t.entry_date desc

ee/legacy/database/drivers/mysqli/mysqli_connection.php:117 Stack Trace: Please include when reporting this error

#0 admin\ee\legacy\database\drivers\mysqli\mysqli_driver.php(112): CI_DB_mysqli_connection->query('SELECT COUNT(*)...')
#1 admin\ee\legacy\database\DB_driver.php(270): CI_DB_mysqli_driver->_execute('SELECT COUNT(*)...')
#2 admin\ee\legacy\database\DB_driver.php(180): CI_DB_driver->simple_query('SELECT COUNT(*)...')
#3 admin\user\addons\publisher\legacy\libraries\Publisher_search.php(284): CI_DB_driver->query('SELECT COUNT(*)...')
#4 admin\user\addons\publisher\ext.publisher.php(993): Publisher_search->modify_result_query('SELECT DISTINCT...', '094fb32d5241e8b...')
#5 admin\ee\legacy\libraries\Extensions.php(222): Publisher_ext->channel_search_modify_result_query('SELECT DISTINCT...', '094fb32d5241e8b...')
#6 admin\ee\legacy\libraries\Extensions.php(117): EE_Extensions->call_class('Publisher_ext', 'channel_search_...', Array, Array)
#7 admin\ee\EllisLab\Addons\search\mod.search.php(1310): EE_Extensions->call('channel_search_...', 'SELECT DISTINCT...', '094fb32d5241e8b...')
#8 admin\ee\legacy\libraries\Template.php(1847): Search->search_results()
#9 admin\ee\legacy\libraries\Template.php(1482): EE_Template->process_tags()
#10 admin\ee\legacy\libraries\Template.php(578): EE_Template->tags()
#11 admin\ee\legacy\libraries\Template.php(234): EE_Template->parse('&#123;!-- ra:0000000...', false, 1, false)
#12 admin\ee\legacy\libraries\Template.php(165): EE_Template->fetch_and_parse('search', Array, false)
#13 admin\ee\legacy\libraries\Core.php(661): EE_Template->run_template_engine('search', 'index')
#14 admin\ee\legacy\controllers\ee.php(63): EE_Core->generate_page()
#15 [internal function]: EE->index()
#16 admin\ee\EllisLab\ExpressionEngine\Core\Core.php(241): call_user_func_array(Array, Array)
#17 admin\ee\EllisLab\ExpressionEngine\Core\Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#18 admin\ee\EllisLab\ExpressionEngine\Boot\boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#19 index.php(173): require_once('D:\\www\\wamp64\\w...')
#19 index.php(173): require_once('D:\\www\\wamp64\\w...') 
#7

BoldMinded (Brian)

I was curious what would happen in that scenario. I’ll take a look and get a new build to you in the next couple of days.

#8

BoldMinded (Brian)

Comment has been marked private.

#9

BoldMinded (Brian)

Closing this ticket b/c the provided build should fix it. Will also be included in the next release of Publisher.

Login to reply