0

ExpressionEngine 2.8.1 Solspace SuperSearch 2.1.4

We're currently experiencing an error that does not occur each time a form is submitted with the following error being displayed:

Error Number: 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 c.channel_id != '' AND cf.field_name != 'keywords'' at line 4

/* Super Search get fields */ SELECT cf.field_id,cf.field_name,cf.field_search,cf.field_type,cf.field_text_direction,c.channel_id,c.channel_name FROM exp_channel_fields cf LEFT JOIN exp_channels c ON c.field_group = cf.group_id WHERE cf.site_id IN () AND c.channel_id != '' AND cf.field_name != 'keywords'

Filename: third_party/super_search/mod.super_search.php

Line Number: 2190

A separate error occurs every once in awhile in Chrome when submitting to the same form:

Fatal error: Call to a member function num_rows() on a non-object in /home1/clientaccount/public_html/system/expressionengine/third_party/super_search/mod.super_search.php on line 2192

PHP Error Log:

[21-May-2014 09:51:56] PHP Fatal error:  Call to a member function num_rows() on a non-object in /home1/clientaccount/public_html/system/expressionengine/third_party/super_search/mod.super_search.php on line 2192

The odd items is that the error is coming from SuperSearch, but the only instance of the search is in the header + footer and not related to the form generated by Forms by DevDemon.

Form Code:

        {exp:channel:entries channel="staff_only" limit="1" dynamic="yes"}
        {standard_form}
        {/exp:channel:entries}

Header SuperSearch:

<form class="non-mobile" action="{path=search/index}" method="post">
      {exp:super_search:search}
        <input type="hidden" name="XID" value="{XID_HASH}" />
        <input type="text" list="suggestions" autocomplete="off" name="keywords" placeholder="Search" value="">
        <button type="submit" name="Submit"><img src="{site_url}img/icon-search.png" alt="Search"></button>

          <datalist id="suggestions">
          {exp:channel:entries channel="not home" limit="100" dynamic="no"}
              <option value="{title}">
          {/exp:channel:entries}
          </datalist>
      {/exp:super_search:search}
    </form>

Footer SuperSearch:

<form class="non-mobile" action="{path=search/index}" method="post">
      {exp:super_search:search}
        <input type="hidden" name="XID" value="{XID_HASH}" />
        <input type="text" list="suggestions" autocomplete="off" name="keywords" placeholder="Search" value="">
        <button type="submit" name="Submit"><img src="{site_url}img/icon-search.png" alt="Search"></button>

          <datalist id="suggestions">
          {exp:channel:entries channel="not home" limit="100" dynamic="no"}
              <option value="{title}">
          {/exp:channel:entries}
          </datalist>
      {/exp:super_search:search}
    </form>

Any assistance would be greatly appreciated.

  • Best place to start is by checking line 2192 in /system/expressionengine/third_party/super_search/mod.super_search.php? What's it trying to do there? – Anna_MediaGirl May 21 '14 at 15:53
  • Have you tried removing the {exp:super_search:search} tag pair? It's actually not necessary in most cases, and just used in cases where you want Super Search to try and retrieve past search credentials, through cookies, when clicking the "Back" button of your browser. Also used if using the Search History feature, which doesn't seem to be the case here. Finally, try testing the search form completely alone in a blank template (i.e. no CSS, JS, header, footer, sidebars, 3rd-party tags/variables, etc). Does it work in that situation? – Solspace May 22 '14 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.