Problem/Motivation

Error: Call to a member function getParameter() on null in Drupal\panels_ipe\Form\PanelsIPEBlockPluginForm->getContextsForPath() (line 505 of /var/www/docroot/modules/contrib/panels/panels_ipe/src/Form/PanelsIPEBlockPluginForm.php)

Steps to reproduce

Use Panels IPE Form to add content to page.
Used modules, panels and panelizer. Missing page_manager.

Proposed resolution

Check if the isset variable $page

Issue fork panels-3465159

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lukasz.tyc created an issue. See original summary.

luk.tc’s picture

rollins’s picture

Status: Active » Needs review
rollins’s picture

Status: Needs review » Reviewed & tested by the community

Changes from MR make sense
It will avoid error message about getParameter()

luk.tc’s picture

sc_cojocari’s picture

StatusFileSize
new968 bytes

Could it be because of wrong variables ?

inascon’s picture

Neither of the patches worked for me. Attached a patch I now use which solves the problem for me.
I hope this helps to solves the problem.

f2boot’s picture

Patch in #7 is working for me
(aligning with changes in page_manger since patch from Path has unnecessary query appended is committed)

joseph.olstad made their first commit to this issue’s fork.

k-l’s picture

None of the patches worked on Drupal 10.3.12, Panels 4.8, Panelizer 4.5.0.

Simple `Powered By Drupal` block was added to new empty panel and error occurred when saving panel:

Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID 'eae2393c-52b3-4d7a-a134-f9af02ec7aec' was not found. in Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (line 79 of core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php).
Drupal\Component\Plugin\LazyPluginCollection->get('eae2393c-52b3-4d7a-a134-f9af02ec7aec') (Line: 19)
Drupal\ctools\Plugin\BlockPluginCollection->get('eae2393c-52b3-4d7a-a134-f9af02ec7aec') (Line: 43)
Drupal\ctools\Plugin\DisplayVariant\BlockDisplayVariant->getBlock('eae2393c-52b3-4d7a-a134-f9af02ec7aec') (Line: 55)
Drupal\panels_ipe\Helpers\UpdateLayoutRequestHandler::updatePanelsDisplay(Object, Array) (Line: 24)
Drupal\panels_ipe\Helpers\UpdateLayoutRequestHandler->updateLayout(Object, Array, ) (Line: 13)
Drupal\panels_ipe\Helpers\UpdateLayoutRequestHandler->handle(Object, Array, ) (Line: 49)
Drupal\panels_ipe\Helpers\RequestHandlerBase->handleRequest(Object, Object) (Line: 251)
Drupal\panels_ipe\Controller\PanelsIPEPageController->handleUpdateLayoutRequest('panelizer_default', '*node:11878:full:default', Object)

When adding Content -> ID block (to simply show node id) after clicking `Add` block button:

Drupal\Component\Plugin\Exception\MissingValueContextException: Required contexts without a value: entity in Drupal\Core\Plugin\Context\ContextHandler->applyContextMapping() (line 150 of core/lib/Drupal/Core/Plugin/Context/ContextHandler.php).
Drupal\panels_ipe\Form\PanelsIPEBlockPluginForm->buildBlockInstance(Object, Object) (Line: 331)
Drupal\panels_ipe\Form\PanelsIPEBlockPluginForm->submitForm(Array, Object, Object)
call_user_func_array(Array, Array) (Line: 69)
Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object, Array, Object, Array) (Line: 112)
Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object, 'kernel.exception', Object)
call_user_func(Array, Object, 'kernel.exception', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.exception') (Line: 239)
Symfony\Component\HttpKernel\HttpKernel->handleThrowable(Object, Object, 1) (Line: 91)

No problems on Panels 4.7.

mvonfrie’s picture

Same for me, but a combination of #7 and #8 works. In addition we have to consider that the change from page_manager_page to _page_manager_page only has been introduced recently: #3362561: Path has unnecessary query appended.. I try to create a new patch by tomorrow.

mvonfrie’s picture

Status: Reviewed & tested by the community » Needs work
mvonfrie’s picture

Status: Needs work » Needs review
joseph.olstad’s picture

Haven't looked closely however I did look at the pipeline. In the unit tests I'm seeing two additional fails with the latest commit. Not sure if it's related but could be.

There was 1 error:
1) Drupal\Tests\panels\Functional\PanelsConfigSchemaTest::testPanelsConfigSchema
Exception: Config for Panels display doesn't validate: display_variant.plugin.panels_variant:blocks.46b47fa7-8206-49fa-b248-dc29b224c5ff.view_mode: missing schema
/builds/issue/panels-3465159/src/PanelsDisplayManager.php:74
/builds/issue/panels-3465159/src/PanelsDisplayManager.php:84
/builds/issue/panels-3465159/tests/src/Functional/PanelsConfigSchemaTest.php:56
mvonfrie’s picture

@joseph.olstad, view modes should not be affected by this if they weren't by patch #7 and #8 individually. In the MR I see two older commits merged by you starting with "Issue #3470578 and Issue #3465159" and two older commits starting with "Issue #3456918". So the branch dedicated for this issue (3465159-error-call-to) contains changes for two other issues as well. Maybe the additional test failures are related to those commits, or maybe there are incompatible changes on the main branch and the working branch 3465159-error-call-to should be rebased to incorporate those changes?

anairamzap made their first commit to this issue’s fork.

anairamzap’s picture

Version: 8.x-4.8 » 8.x-4.x-dev

Hi everyone, we needed to fix this for a project so I've created a new branch and a MR that includes changes from #2, #7 and #8.
Also changing the version to latest 8.x-4.x dev (since the MR branch is based on that branch).

Updated the fork to include the latest security changes.

Tested the patch on a brand new D10 test site using 8.x-4.x-dev and on a project using the 8.x-4.9.

ccolumbie’s picture

I upgraded to panels 4.9.0 and I'm using panelizer 4.4, although I also tried 4.5.
After applying the patches to avoid getParameter() errors, when creating a new block or using an existing one, ONLY ON NEW NODES, when trying to save changes with panel ipe I get a 500 error on URLs like the following: http://localhost:8080/admin/panels_ipe/variant/panelizer_default/*node:3... and the following response:
The website encountered an unexpected error. Try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID '4badb79d-a544-43f0-8e04-27528643c832' was not found. in Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (line 79 of core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php).

Drupal\Component\Plugin\LazyPluginCollection->get('4badb79d-a544-43f0-8e04-27528643c832') (Line: 19)
Drupal\ctools\Plugin\BlockPluginCollection->get('4badb79d-a544-43f0-8e04-27528643c832') (Line: 43)
Drupal\ctools\Plugin\DisplayVariant\BlockDisplayVariant->getBlock('4badb79d-a544-43f0-8e04-27528643c832') (Line: 55)
Drupal\panels_ipe\Helpers\UpdateLayoutRequestHandler::updatePanelsDisplay(Object, Array) (Line: 24)
Drupal\panels_ipe\Helpers\UpdateLayoutRequestHandler->updateLayout(Object, Array, ) (Line: 13)
Drupal\panels_ipe\Helpers\UpdateLayoutRequestHandler->handle(Object, Array, ) (Line: 49)
Drupal\panels_ipe\Helpers\RequestHandlerBase->handleRequest(Object, Object) (Line: 251)
Drupal\panels_ipe\Controller\PanelsIPEPageController->handleUpdateLayoutRequest('panelizer_default', '*node:3302:full:default', Object) (Line: 287)
Drupal\panels_ipe\Controller\PanelsIPEPageController->handleCreateLayoutRequest('panelizer_default', '*node:3302:full:default', Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 31)

This doesn't happen in version 4.7.0, but it does starting with 4.8.0. What's the cause and how can I fix it?

joseph.olstad’s picture

@ccolumbie , please try this patch: https://git.drupalcode.org/project/panels/-/merge_requests/31.diff

cd /path/to/ccolumbie/drupal/html/modules/contrib/panels;
curl https://git.drupalcode.org/project/panels/-/merge_requests/31.diff > ipe.patch;
patch -p1 < ipe.patch;

if curl doesn't work, try wget

cd /path/to/ccolumbie/drupal/html/modules/contrib/panels;
wget https://git.drupalcode.org/project/panels/-/merge_requests/31.diff
patch -p1 < 31.diff;
rakesh.regar’s picture

StatusFileSize
new2.98 KB

Fixes this issue on panels 8.x-4.9

joelpittet changed the visibility of the branch 8.x-4.x to hidden.

  • joelpittet committed 867ee814 on 8.x-4.x authored by anairamzap
    fix: #3465159 Fix "Call to a member function getParameter() on null" in...
joelpittet’s picture

Status: Needs review » Fixed

Thanks everyone for your patience on this one, and for the persistence in getting to the real cause. This is now merged to 8.x-4.x.

Credit to @anairamzap for MR 31 pulling the working pieces together, @luk.tc for the original report and MR 26, @inascon and @f2boot for the patches in #7 and #8, @mvonfrie for spotting the parameter rename, and @joseph.olstad for the earlier MR and review. Really appreciate the collaboration.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.