Skip to content

Conversation

@ArjenMiedema
Copy link

Fixed an issue where the values for dropdown attribute options were saved incorrectly

@digitalpianism
Copy link
Owner

Side node to replicate the issue:

  • setup multistore environment
  • make sure your store_ids are NOT 1,2,3,4 but for example 2,5,7,8 (by deleting some stores you do not use anymore)
  • edit a dropdown attribute and add values for all storeviews
  • save the attribute

Expected behavior: attributes ar saved as they were entered

Actual behavior:

  • data gets lost for certain storeviews
  • values are moved along the stores

We found piece of code that causes this to be in Mage_Adminhtml_Catalog_Product_AttributeController::_filterPostData() on line 188 it does an array_fill

@digitalpianism digitalpianism merged commit 8dec393 into digitalpianism:master Oct 17, 2016
@HenKun
Copy link

HenKun commented Oct 22, 2016

Small additon:

The issue is not due to the array_fill directly, but to the second parameter to array_map in general:

From php documentation: "The returned array will preserve the keys of the array argument if and only if exactly one array is passed. If more than one array is passed, the returned array will have sequential integer keys. "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants