Closed storepeinture closed 6 years ago
The exact same attribute problem happened to me a while back in 2.1.2
/ 2.1.4
It was in fact related to Magento system attributes for Default being moved from one category to another. In my case it was the price
attribute.
What shows up in your dev tool console when your loading overlay hangs?
I get the following feedback from chrome dev tools console:
codemirror.js:3507 Uncaught TypeError: Cannot read property 'value' of null at Function.window.CodeMirror.CodeMirror.fromTextArea (codemirror.js:3507) at chrome-extension://akgknbhjhjdjhjgpknnblckigmofmopb/init.js:1
multiselect.js:52 Uncaught TypeError: Cannot read property 'length' of undefined at UiClass.setPrepareToSendData (multiselect.js:52) at setNested (objects.js:43) at Object.nested (objects.js:117) at UiClass.set (element.js:301) at updateValue (links.js:57) at Function.notifySubscribers (knockout.js:1103) at Function.observable.valueHasMutated (knockout.js:1300) at UiClass.observable [as value] (knockout.js:1285) at setNested (objects.js:43) at Object.nested (objects.js:117)
Looks to be the same error I got @storepeinture.
Compare the layout of the new Default attribute set to one of your attribute sets for the positions of any price/cost, image, stock levels, sku, etc (any & all system) attributes.
Hi Jordanbrauer, brillant advice!! Since I have customized the product attribute sets quite a bit to fit my needs, it took me a while to figure it out ... but in the end it all came down to one item that has moved to another category in the default version. I already saw myself creating a duplicate attribute set, but this way my installation stays clean 👍
Do you have any idea about the cart price rules issue? If I delete the current cart price rules, and create identical new ones everything works again. But I assume if you have 100s or coupon codes or so that might not be so practical.
Thank you!
Hey,
Can anyone post how the new default attribute set looks? We have the same problem and I have compared our default attribute set to our custom ones and they are the same with same order.
@storepeinture Glad that helped.
As for the cart price rules I have not a clue what would be causing that. Probably something related to storeid's like everything seems to be in Magento 2 though lol... ¯\_(ツ)/¯ Sorry dude.
I managed to get coupons working when recreating them but other cart price rules doesn't work. Does anyone have any ideas?
We have already created created internal ticket MAGETWO-58212 for the first issue. But second issue i can't reproduce, as described. Please add some additional information about cart price rule configuration or any information which would be helpful to reproduce it.
Is there a workaround?
Amenk, the workaround so far was: Save the rules somewhere, delete them, and recreate them ... then it worked again. But that's not how it should be.
vityakopin I have setup the cart price rule as follows:
Websites: Main Website Customer Groups: All Groups except NOT LOGGED IN Coupon: Specific Coupon Coupon Code: discount_10 Uses per Coupon: 0 Uses per Customer: 0 Conditions: Blank
Actions: Apply -> Percent of Product Price Discount Discount Amount -> 10
The rest is standard setting (ZERO, or turned off, or blank).
I hope this helps. If you need more info, I'm glad to help.
I am facing the same issue with attribute set change. Getting error message in console "multiselect.js:52 Uncaught TypeError: Cannot read property 'length' of undefined" .
Is any fix available for Magento 2.1.8?
@storepeinture thank you for your report. We were not able to reproduce this issue (part B) by following the steps you provided. Please try to reproduce this issue on a clean installation of Magento.
@pankajpragma Read my comment in this thread for the fix.
@magento-engcom-team The bug comes from the shops' current (previous version, before upgrading) Default attribute sets' attribute order not matching the new order of the attributes on the Default attribute set (after upgrading). This is true because after matching your attribute sets' system attributes to the order of the new Default attribute sets' attributes, the error goes away (see my linked comment above and @storepeinture\'s success with the fix)
For some reason that throws an error with the JS (assumably a Knockout thing). I'm not sure why the dev team feels the need to reorder the Default attribute sets' attributes so often (this has happened to us in two previous release upgrades lol), but if they do – then they probably need to consider taking a different approach on how the Default attribute set is handled. I see two ways upfront:
multiselect.js:52
.multiselect.js:52 Uncaught TypeError: Cannot read property 'length' of undefined
at UiClass.setPrepareToSendData (multiselect.js:52)
at setNested (objects.js:43)
at Object.nested (objects.js:117)
at UiClass.set (element.js:301)
at updateValue (links.js:57)
at Function.notifySubscribers (knockout.js:1103)
at Function.observable.valueHasMutated (knockout.js:1300)
at UiClass.observable [as value] (knockout.js:1285)
at setNested (objects.js:43)
at Object.nested (objects.js:117)
I am not JS expert, so I can't give much input here, but..... the error leads me to believe that Knockout is expecting the system attribute to be in a particular category, however it is not there due to being moved by shop owners/admins/devs.
A simple but limiting fix /shrug.
@jordanbrauer fix worked for me. Just delete the new attribute set and recreate it based on the default attribute set.
@storepeinture, thank you for your report. We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue. We tested the issue on 2.1.7, 2.1.8
I have merged two issues together, because the workaround is the same and I believe they are somewhat related:
Preconditions
A. Attribute Sets
Steps to reproduce
Expected result
The specific attribute set is added to the new product
Actual result
The Cart Price Rule is not applied. The "Please wait ..." spinner is turning indefinitely
B. Cart Price Rule
Steps to reproduce
Expected result
The Cart Price Rule is applied
Actual result
The Cart Price Rule is not applied. I receive the following message:
Workaround
In both cases it worked to delete the attribute set / cart price rule and create a new identical rule. For the attribute set, it is important to create the attribute set based on DEFAULT!
The problem seems to have existed under similar circumstances in prior installations. https://github.com/magento/magento2/issues/7825 In my case it only started after the upgrade from 2.1.7 -> 2.1.8.