-
Notifications
You must be signed in to change notification settings - Fork 9.4k
11828 Fix issue with swatch colour block not showing in admin panel once colour selected (PHP7.1.x issue). #13101
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
11828 Fix issue with swatch colour block not showing in admin panel once colour selected (PHP7.1.x issue). #13101
Conversation
@chris-pook could you explain what it was returning in php 7.0? There is string to array conversion, so probably we were getting some unexpected result |
Hi @ihor-sviziev on php7.0 an array is returned containing the inline style strings as set by the function. The problem is that using php7.1 the strings are truncated due to the odd way they are produced using array notation on To see the issue introduced in php7.1 you can run the following code:
With php7.0 this will produce:
With php7.1 this will output:
|
@@ -84,15 +84,15 @@ public function getJsonConfig() | |||
* Parse swatch labels for template | |||
* | |||
* @codeCoverageIgnore | |||
* @param null $swatchStoreValue | |||
* @return string | |||
* @param array $swatchStoreValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can still be null
. Could you also squash changes into single commit and force push?
…nce colour selected (PHP7.1.x issue).
@orlangur updated docblock and squashed commits down to 1 (apologies for multiple updates, messed up a local merge). |
…n admin panel once colour selected (PHP7.1.x issue). #13101
Description
Using PHP7.1.x the swatch colour block preview in the admin panel attribute will not show the actual colour as the inline style is set to style"b". This is due to PHP no longer allowing strings to be manipulated as arrays.
Fixed Issues (if relevant)
Manual testing scenarios
Preconditions
Magento CE 2.2
PHP 7.1.0
Steps to reproduce
Inside admin, go to Stores->Product and click on an attribute that contains visual swatches.
Expected result
Visual Swatches that have a color assigned should show that color in the swatch box.
Actual result
Although the color swatch values are being saved, the visual representation of the color in the box is colorless.
Contribution checklist