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

Fix error loading theme configuration on PHP 7.2 #12606

Merged
merged 1 commit into from
Dec 11, 2017

Conversation

Alanaktion
Copy link

@Alanaktion Alanaktion commented Dec 8, 2017

This fixes an issue loading theme configuration on PHP 7.2 by checking that $parentPathPieces is an array before counting it, avoiding an error when the value is NULL. PHP no longer allows running count() on non-countable types.

An easy way to trigger this bug in the current 2.2 branch is to run the setup:upgrade command:

$ php bin/magento setup:upgrade
...
Running data recurring...
Warning: count(): Parameter must be an array or an object that implements Countable in vendor/magento/framework/View/Design/Theme/ThemeList.php on line 237

This might be better to merge into 2.3, but I'm not sure what the planned version support/release scheduled for 2.2 vs 2.3 is.

This fixes an issue loading theme configuration on PHP 7.2
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Dec 8, 2017

CLA assistant check
All committers have signed the CLA.

@avoelkl avoelkl self-assigned this Dec 11, 2017
@avoelkl
Copy link
Contributor

avoelkl commented Dec 11, 2017

@Alanaktion Even though this helps PHP 7.2 compatibility, performing the additional is_array check is good anyway so i think it's ok go into 2.2 :)
It can be forward ported to 2.3 after we merged this one (either you provide an additional PR or the core team can do it). First we process this one.

@avoelkl avoelkl added this to the December 2017 milestone Dec 11, 2017
@magento-team magento-team merged commit bf611be into magento:2.2-develop Dec 11, 2017
magento-team pushed a commit that referenced this pull request Dec 11, 2017
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-85332: Fix error loading theme configuration on PHP 7.2 #12606
 - MAGETWO-85307: 12468: Sort by Price not working on CatalogSearch Page in Magento 2 #929
 - MAGETWO-85303: #12582: Can't remove item description from wishlist #981
 - MAGETWO-85297: 8410: Custom Checkout Step and Shipping Step are Highlighted and Combined upon Checkout page load #975
 - MAGETWO-85290: 7467: File Put Contents file with empty content. #962
@avoelkl
Copy link
Contributor

avoelkl commented Dec 12, 2017

@Alanaktion Thanks for the PR!

@Alanaktion Alanaktion deleted the themelist-null-fix branch December 12, 2017 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants