xoops forums

jlm69

Module Developer
Posted on: 2015/7/26 11:45
jlm69
jlm69 (Show more)
Module Developer
Posts: 719
Since: 2002/7/19
#1

2.6.0 search module errors

In the search, on my modules search pages, everything works perfectly. If I use Xoops search I get errors caused by using 'IN' in mysql. Xoops seems to not know what to do with 'IN'. It does not matter how I do it like this:

$criteria->add(new Criteria('cid', '('.$all_ids.')', 'IN'));

or like this

->andWhere($eb->in('cid', $jobs_ids))

like I said they work perfectly in the search within my modules, but if I try the search module it does not treat 'IN' properly.
In the first example it treats 'in' like '<>' which produces no results when there are results.

0.000310 - SELECT * FROM alumni_listing WHERE (valid = :dcValue1 AND cid <> cid AND name LIKE :dcValue2 OR mname LIKE :dcValue3
OR lname LIKE :dcValue4 OR year LIKE :dcValue5) ORDER BY date DESC LIMIT 5 OFFSET 0


In the second example it throughs an exeption.


You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
near ')) AND ((title LIKE '%test%') OR (type LIKE '%test%') OR (company LIKE '%test%')' at line 1' in
LIB/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91

If I remove the lines it works, except it shows all results even if you don't have permission to see them.

PHP - 5.6.10
MYSQL - 5.5.5-10.0.19-MariaDB

Thanks,
John

geekwright

Quite a regular
Posted on: 2015/8/4 20:10
geekwright
geekwright (Show more)
Quite a regular
Posts: 296
Since: 2010/10/15
#2

Re: 2.6.0 search module errors

I've responded to this issue on GitHub, where we track issues and resolutions.

https://github.com/XOOPS/XoopsCore/issues/373