We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13639
    • 3 Posts
    I’ve just tested a standard install of AjaxSearch 1.7.1, 1.7.0.2 and 1.6 and I’ve found that in 1.7.1 only, searching on a string containing a single quote next to an alphabetic character eg "beginner’s" returns the following error:

    [tt]« MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - 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 ’s%’ OR sc.longtitle LIKE ’%beginner\\’s%’ OR sc.description LIKE ’%beginner\\’s%’ at line 1 »
    SQL: SELECT DISTINCT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.introtext, sc.content FROM `dbs`.`site_content` sc LEFT JOIN `dbs`.`site_tmplvar_contentvalues` stc ON sc.id = stc.contentid WHERE (sc.pagetitle LIKE ’%beginner\\’s%’ OR sc.longtitle LIKE ’%beginner\\’s%’ OR sc.description LIKE ’%beginner\\’s%’ OR sc.introtext LIKE ’%beginner\\’s%’ OR sc.content LIKE ’%beginner\\’s%’ OR stc.value LIKE ’%beginner\\’s%’) AND sc.privateweb=0 AND sc.published=1 AND sc.searchable=1 AND sc.deleted=0; [/tt]

    I’m using MODx 0.9.6 and WAMP5 1.7.2 on XP Pro SP2, errors appear in Firefox 3 and IE7. I’m using my own (xhtml validated) template, but have tested it with all my own javascript removed as well to see if that made any difference - it didn’t.

    The error is about an extra escape before the quote in the SQL command, but I’m happy to rollback to 1.7.0.2 for now as I’m short of time. I’m just pointing up my experience in case anyone else comes across the same problem.

    I’m happy to be corrected if I’ve made any obvious mistakes.

    Cheers all,

    James
      • 5811
      • 1,717 Posts
      Thanks James to report this issue.
      A correction to this issue is available here. This issue is also corrected in the version 1.8 in preparation.
      Some other issues are also reported on a bug tracker dedicated to AjaxSearch here
        • 13639
        • 3 Posts
        coroico,

        Thanks for that - I’ll make the change and switch back to 1.7.1 , and promise to do an even more thorough search of the forum next time round!

        Kind regards,

        James