Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

"You have an error in your SQL syntax" when trying to enable Features

Featured Replies

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 ')) GROUP BY fv.id_feature, IFNULL(fv.custom, 0)' at line 3

in file controllers/admin/AdminFeaturesController.php at line 745
 
SELECT id_feature, IFNULL(fv.custom, 0) as is_custom, COUNT(fv.id_feature_value) as count_values
FROM `ps_feature_value` fv
WHERE (fv.id_feature IN ())
GROUP BY fv.id_feature, IFNULL(fv.custom, 0)

 

 $ids = array_map('intval', array_column($this->_list, 'id_feature'));
728:            $extra = [];
729:            foreach ($ids as $id) {
730:                $extra[$id] = [
731:                    'value' => 0,
732:                    'custom' => 0,
733:                    'products' => 0,
734:                ];
735:            }
736:
737:            $conn = Db::getInstance(_PS_USE_SQL_SLAVE_);
738:
739:            // count feature values
740:            $valuesQuery = new DbQuery();
741:            $valuesQuery->select('id_feature, IFNULL(fv.custom, 0) as is_custom, COUNT(fv.id_feature_value) as count_values');
742:            $valuesQuery->from('feature_value', 'fv');
743:            $valuesQuery->where('fv.id_feature IN ('. implode(',', $ids).')');
744:            $valuesQuery->groupBy('fv.id_feature, IFNULL(fv.custom, 0)');
745:            $res = $conn->executeS($valuesQuery);
746:            if (is_array($res)) {
747:                foreach ($res as $row) {
748:                    $id = (int)$row['id_feature'];
749:                    if ($row['is_custom']) {
750:                        $extra[$id]['custom'] = (int)$row['count_values'];
751:                    } else {
752:                        $extra[$id]['value'] = (int)$row['count_values'];
753:                    }
754:                }
755:            }

 

What is causing this issue?

I'm on almost latest bleeding edge and I have features in other 2 shops with this version. I didn't need them in this one until now.

Cheers!

Solved by datakick

2 hours ago, the.rampage.rado said:

WHERE (fv.id_feature IN ())

Hard to tell i.e. what is that for v.id_feature IN ???

try to change:

$valuesQuery->select('id_feature, IFNULL(fv.custom, 0) as is_custom, COUNT(fv.id_feature_value) as count_values');

to:

$valuesQuery->select('fv.id_feature, IFNULL(fv.custom, 0) as is_custom, COUNT(fv.id_feature_value) as count_values');

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.