-- HikaShop version -- : 6.6.0
-- Joomla version -- : 5.4.8
-- PHP version -- : 8.3.33
-- Browser(s) name and version -- : Chrome 154.0
Hello,
I am encountering an SQL syntax error related to a custom product field used inside a HikaShop Filter. After detailed testing, I identified a specific pattern that seems to indicate a bug in how the Min/Max length filter generates its SQL conditions.
Code:
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 ((hikam_vendor.vendor_published IS NULL OR hikam_vendor.vendor_publish...' at line 1
Context
- "pas cu pas" = "step by step".
- I created a custom product field in HikaShop.
- This field is used in a Filter module with Minimum length and Maximum length.
- Search processing is set to “every words”.
Pattern of the issue
The SQL error appears
only when all searched words have a length equal to or less than the Min value.
Examples:
- If Min = 3 and the search term is “pas cu pas”, the error occurs because all words (“pas”, “cu”, “pas”) have length ≤ 3.
- If Min = 2 and the search term is “pa cu pas”, the error does not occur because “pas” has 3 characters, which is greater than Min.
- In general, if at least one searched word is longer than Min, the SQL error does not appear.
So the issue seems to be triggered only when "
Search processing
" = "
every words / any word"
and
Minimum length ≤ Searched value , which likely results in a malformed or empty SQL condition.
You have the link to the testing website, it is using ajax in search, so you need to refresh the page to see the error if not showing.
PS. In this new version of the forum I don't see the option to add protected data here, I would have given you the username and password to check on the testing site.