I’m trying to upgrade my store from V2.3 to V2.3.1. I’m working on my local development version and have got almost everything working. I use text swatches which work fine in V2.3 but in V2.3.1 all I see in the swatch is “null”. I know the correct text is being sent to the page as I see it when I hover over the swatch (see the image below where you can see the second colour swatch has the value Grey). I suspect something isn’t working with the javascript but I’ve no idea where to start looking. There are no errors in the console log btw.
3
Answers
I've tracked the problem down to something in swatch-renderer.js. The V2.3 version has the following line at 517:
The version V2.3.1 has changed this to the following:
and the value is then used in the following statement to put the text into the html:
I used alert() to see the content of value before and after each variant of this statement as well as its type. Before it's undefined, after it's null for both variants yet changing this back to the old version resolves the problem! That's probably because before in V2.3 it's of type object whereas in V2.3.1 it's of type string (and presumably has the value "null"!).
I'll be honest, my knowledge of javascript is fairly limited. Does this look like an error? If so, what would be the best way to fix it (I presume test for the sting "null")?
Please update Product Attribute "Admin" Columns From Backend. Then perform Reindexing.