Closed (fixed)
Project:
Page Manager
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Feb 2022 at 10:31 UTC
Updated:
7 Sep 2022 at 19:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaWill this work? I don't know.
Comment #3
anybodyPUSH as PHP 8.1 is becoming more important.
This is the affected line:
and this is the whole function:
So indeed I guess $tree is FALSE somewhere and should be better checked?
Comment #4
fskreuz commentedIt's a bit complicated because
#treeis declared as a variable of thepage_manager_wizard_treetheme and has a default value of[], which becomes thetreeproperty in the variables array (See page_manager_ui_theme()).But then we're dealing with a form here, and
#treeis also the#treeform render element property for form element tree-ness. TheFALSEis coming fromDrupal\Core\Form\FormBuilder::doBuildForm()'s logic of building the tree-ness of a form element.The patch works around this issue by treating
treeas what page manager wants it to be, an array "tree" of things. But I think the more proper fix is to rename#treeto something else to avoid the collision. However, I don't know the implications of this change.Comment #5
fskreuz commentedHere's a different patch that renames
#treeto something else to avoid the collision.Comment #6
fskreuz commentedFound a few more while working with Page Manager today. The additions avoid passing
$page->getPath(), which isNULLduring page creation, tostrpos()andpreg_match_all().Comment #7
anybodyThanks @fskreuz! Also for your explanations in #4. I guess it would now make sense if a maintainer would have a look?
Comment #8
anybodyComment #9
fskreuz commented@anybody re: #7, makes sense to loop in a maintainer to go over that one.
Comment #12
japerryLets bump the tree conversation to another issue. #tree != tree. And we see $variable['tree'] is being set at the end, even with the tree_structure change... so I don't want to mess with that here.
The other PHP 8.1 issues have been fixed. Sorry I didn't get around to getting my patch in here, but it roughly does the same as the patches above.