Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[-] BO: Wrong multi-language features #2723

Merged
merged 2 commits into from Apr 22, 2015

Conversation

@kpodemski
Copy link
Contributor

commented Mar 22, 2015

The easiest way to describe it like this: the front-office shows good values, back-office bad

why?

  1. We updated PrestaShop from 1.4 to 1.6
  2. We deleted few languages, custom feature values was not deleted (and maybe this is something what we should fix too)
  3. array looked like this:

[0] => array with values for id_lang = 1
[1] => array with values for id_lang = 2
[2] => array with values for id_lang = 3

Now when we have one language PrestaShop tried to get [0] but should get [2], it's because for some reason you try to get array value by key, I think this change prevents such a problem and make sure that array is always provided by correct language_id

After the change array looks like this:
[1] => array with values for id_lang = 1
[2] => array with values for id_lang = 2
[3] => array with values for id_lang = 3

of course in our case we could change $k to $k+1 but I think it's not the effective solution.

Let me know if you neeed more information about this problem.

@erouvier29

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2015

About point 2 (custom feature values were not deleted), you may have a look to #2687

@kpodemski

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2015

@jeromenadaud any news? I hope that this will be implemented or solved in other way because we have already deleted languages and this is only way to help with issue

@kpodemski

This comment has been minimized.

Copy link
Contributor Author

commented Apr 21, 2015

@jeromenadaud reminder 🙏

@@ -4728,6 +4728,13 @@ public function initFormFeatures($obj)
if ($custom)
$features[$k]['val'] = FeatureValue::getFeatureValueLang($features[$k]['current_item']);

This comment has been minimized.

Copy link
@jnadaud

jnadaud Apr 21, 2015

Contributor

Hi,

Why not join same if in one ?

This comment has been minimized.

Copy link
@kpodemski

kpodemski Apr 21, 2015

Author Contributor

Sorry, this first should be removed, I'll fix this

@jnadaud

This comment has been minimized.

Copy link
Contributor

commented Apr 21, 2015

Hi @kpodemski

Ok for me, maybe join two if please.

Best regards.

@jnadaud jnadaud removed the pending review label Apr 21, 2015

@kpodemski

This comment has been minimized.

Copy link
Contributor Author

commented Apr 21, 2015

Ok @jeromenadaud , ready

jnadaud pushed a commit that referenced this pull request Apr 22, 2015
Jérôme Nadaud
Merge pull request #2723 from kpodemski/fix-ml-features
[-] BO: Wrong multi-language features

@jnadaud jnadaud merged commit d401828 into PrestaShop:1.6 Apr 22, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jnadaud

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2015

Hi @kpodemski

Thank you for your contribution.

Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.