-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fixed: PHP 8: Layout interface broken - Unknown named parameter $id #5312
Comments
I filed a PR at backdrop/backdrop#3805 that I think will fix this problem. I think PHP 8 now includes magic parameter mapping, where it will read the name of the parameter and pass in the right value to a function based on the key name. |
Hehe, array_values() - so simple. (I could have sworn, I tried that - but had other test failures then...) Tests are passing! And I confirmed locally that adding contexts works properly now on PHP 8. RTBC 👍 |
…mpatibility. By @quicksketch and @indigoxela.
…mpatibility. By @quicksketch and @indigoxela.
Super, I merged backdrop/backdrop#3805 into 1.x and 1.20.x. Thanks @indigoxela! |
Description of the bug
Part of #5076 (meta).
Layout contexts seem to be broken for entities with PHP 8.
Related failing tests:
Steps To Reproduce
Actual behavior
Error: Unknown named parameter $id in Layout->getContexts() ( ... core/modules/layout/includes/layout.class.inc).
Additional information
I know, what's causing this, but I can't fix it (without breaking something else).
In function getContexts() the settings contain a key-value array, which is passed as argument to the "load function" - node_load (entity_load) in this case, but entity_load doesn't seem to handle this anymore.
What it gets:
What it expects:
So on PHP 8 entity_load chokes on the "id" key.
Asking @docwilmot for help. 😉
The text was updated successfully, but these errors were encountered: