Problem/Motivation
PanelizerWizardContextForm calls the parent constructor like so:
parent::__construct($typed_data_manager, $form_builder);
However, as of CTools 3.1, the parent constructor requires a third argument:
public function __construct(TypedDataManagerInterface $typed_data_manager, FormBuilderInterface $form_builder, TypedDataResolver $ctools_typed_data_resolver) { ... }
Therefore, Panelizer is pretty broken on CTools 3.1. :(
Proposed resolution
Fix the constructor call, and require at least CTools 3.1.
Remaining tasks
Patch it.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
Comments
Comment #2
phenaproximaComment #4
hyperlinkedI second this and I was about to post the same issue with a nearly identical patch. The only difference between the way I patched it and and the way @phenaproxima did was that I made the TypedDataResolver the fourth argument instead of the third of the __construct() operation. The only reason I bring this up is that I'm interested in knowing if there's a best practice for how to add a new argument in cases like this.
I added it as the 4th argument just in case there was something extending the PanelizerWizardContextForm class and was providing the SharedTempStoreFactory object as the third argument, the change wouldn't break anything.
There isn't anything in the contrib codebase that I know of that is extending PanelizerWizardContextForm so this is just an academic question.
Comment #5
phenaproximaI don't know there's any "official" best practice, but your way is better from a backwards compatibility standpoint. :)
Comment #6
phenaproximaI think we also need to update all tempstores to Drupal\Core\TempStore\SharedTempStoreFactory. So this does that...
Comment #8
malmeida287 commentedHi all,
Adding Drupal\Core\TempStore\SharedTempStoreFactory correction on file src/Plugin/PanelsPattern/PanelizerPattern.php to the patch.
Corrects error:
on page /admin/structure/panelizer/edit/node_<node-type>_<view-mode>_<display>/content
Comment #10
Helrunar commented#8 works for me
Comment #11
visantinian commented#8 Fixed my issues
Comment #12
ivavictoriaDropping by to confirm that patch #8 fixes the problem for me as well -- many thanks!!
Comment #13
ewaters5#8 works for me also
Comment #14
ardnet commentedHi,
I've implemented the patch, and I see that it seems solves the problem.
However, unfortunately, I've discovered another problem.
I couldn't save the Panel via IPE afterward, here's the error that I got from dblog:
The problem still persist even after I implemented this patch https://www.drupal.org/files/issues/2874489-12.patch from here: https://www.drupal.org/node/2874489
I haven't debug further again though.
I hope someone can shed me some light on this.
Thanks in advance!
Comment #15
kapil17 commentedHi,
I have Fixed this issue and created a patch. Please review.
Thanks
Comment #16
govind.maloo commentedPatch is good but test is failing need to fix those before moving to further.
Comment #17
anikettoApplying the patch in #15 fixes the issue of
Fatal error: Declaration of Drupal\panelizer\Plugin\PanelsPattern\PanelizerPattern::getDefaultContexts(Drupal\user\SharedTempStoreFactory $tempstore, $tempstore_id, $machine_name) must be compatible with Drupal\panels\Plugin\PanelsPattern\DefaultPattern::getDefaultContexts(Drupal\Core\TempStore\SharedTempStoreFactory $tempstore, $tempstore_id, $machine_name) in /var/www/xxxx/docroot/modules/contrib/panelizer/src/Plugin/PanelsPattern/PanelizerPattern.php on line 14However accessing /admin/structure/panelizer/edit/node__landing_page__default__default/content?js=nojs and trying to clicking on 「+ Add new block」or Edit buttons on existing items does nothing.
Checking console shows below Ajax error:
Comment #18
wylbur commentedThere's a new version of Panelizer, 8.x-4.2, so I rerolled the patch to account for some changes in the new branch.
I made no changes to resolve the issues pointed out in #17.
Comment #19
ivnishComment #20
phenaproximaI agree with #16; the patch needs to be passing tests before it's ready for review.
Comment #21
phenaproximaAlso, downgrading back to major. This is not a critical priority issue, since it does not cause a security hole or data loss.
Comment #22
lamp5@wylbur you attached twice
$container->get('ctools.typed_data.resolver'),so your patch doesn't works.Comment #23
lamp5Comment #24
roam2345 commentedPatch fails to apply to latest dev-4.x
Comment #25
lamp5For me this issue is resolved right now. Please check the latest version of module.
Comment #26
phenaproximaTagging for a reroll.
Comment #27
phenaproximaTry this on for size.
Comment #28
phenaproximaOh, and un-assigning from myself.
Comment #29
japerrylgtm
Comment #30
phenaproximaAdjusting credit for commit.
Comment #32
phenaproximaCommitted and pushed to 8.x-4.x. Thanks for the help on this, everyone!