MySQL version 5.7.17
(The strict level was the default for my MySQL installation.)
Changing the parenthesis like you suggested unfortunately had no effect.
- SELECT DISTINCT
- products AS p
- LEFT JOIN object_to_store AS o2s
- ON p.products_id = o2s.object_id
- AND o2s.object_type_id = 14
- LEFT JOIN object_to_group AS o2g
- ON p.products_id = o2g.object_id
- AND o2g.object_type_id = 14
- p.products_status = 1
- AND p.products_ordered > 0
- AND (o2s.store_1 = 1 OR o2s.store_all = 1)
- AND p.products_master_model = ""
- ORDER BY
- p.products_ordered DESC
To be precise, $best_sellers becomes false instead of ADORecordSet
The method RecordCount exists only for classes of type ADORecordSet. The SelectLimit method does not always return such a set, according to this page.
When it's caused by an SQL error (or missing tables, which could also be the cause of SQL errors), then that'd be a bug as well - since I'm using the default installation, and everything *should* work 'out of the box'.
I'm using the HHG-Multistore CE, version 4.10.2 (latest available).
Internally, the ADO method SelectLimit is used, and then a RecordCount method is called to see how many were selected. However, if no records were selected (the query 'failed'), it will return false (instead of the result). This will result in the page not being able to render correctly (because it'll crash).
Therefore, in `core/classes/class.product.php:600`, I had to change