Prestashop: Custom feature value does not save in multilanguage shop

Created on 2 Jul 2020  路  7Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

A product custom feature value is not saved in backoffice when there are multiple languages installed AND the default language is NOT english.

When only 1 language is installed (any language) and set as default, it works fine.
When multiple languages are installed and enabled, and English is set as default, it works fine.

Expected behavior

Custom feature value should be saved.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Install fresh PS 1.7.6.5
  2. Install and enable second language, and make it default language
  3. Add a predefined feature
  4. Now add a product using a predefined feature AND a custom feature

=> only the predefined feature is saved

Additional information

  • PrestaShop version: 1.7.6.5
  • PHP version: 7.3
1.7.6.5 1.7.7.0 BO Bug Duplicate FO Features Major Products

All 7 comments

Thanks for opening this issue! We will help you to keep its state consistent

To make the bug even more complete. The employee should use the same language as the shop's default language, of it's not te same the user can't edit/create a custom feature.

Hi @TVBZ ,
First you need to downgrade your PHP version. You can have a full overview of PrestaShop system requirement here :
https://devdocs.prestashop.com/1.7/basics/installation/system-requirements/

Just a reminder that PS 1.7.7. will be out soon, no fix will be done on PS 1.7.6.5 (apart from security bugs).

I manage to reproduce your issue in PS 1.7.6.5 :
Capture d鈥檈虂cran 2020-07-02 a虁 15 12 45
Capture d鈥檈虂cran 2020-07-02 a虁 15 12 50

And also in PS 1.7.7.0 :
Capture d鈥檈虂cran 2020-07-02 a虁 15 18 54
Capture d鈥檈虂cran 2020-07-02 a虁 15 18 49

I will add the to our debug roadmap; please stay tuned !
Thanks!

Hi @florine2623. Thanks!

Just downgraded php to 7.2. Sadly the problem persists.

hi, my temporary solution is in product class do change the function :

public function addFeaturesCustomToDB($id_value, $lang, $cust)
   {

     if (trim($cust)=='') {

       $sql = 'SELECT f.`value`'
           .' FROM `'. _DB_PREFIX_.'feature_value_lang` f '
           .' WHERE f.id_feature_value = '.$id_value.' and id_lang<>'.$lang;
       $cust=  Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);


     }

       $row = array('id_feature_value' => (int) $id_value, 'id_lang' => (int) $lang, 'value' => pSQL($cust));

       return Db::getInstance()->insert('feature_value_lang', $row);
   }

Hi @TVBZ,

We are aware of this issue, it is added to our debug roadmap.
Your ticket is a duplicate of #13751
So, I close it.
Thanks!

Duplicate of #13751

Was this page helpful?
0 / 5 - 0 ratings