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)

Created on 1 August 2024, 8 months ago

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

πŸ› Bug report
Status

Active

Version

4.8

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @lukasz.tyc
  • Status changed to Needs review 8 months ago
  • πŸ‡ΊπŸ‡¦Ukraine rollins
  • Status changed to RTBC 8 months ago
  • πŸ‡ΊπŸ‡¦Ukraine rollins

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

  • Pipeline finished with Failed
    8 months ago
    Total: 565s
    #240326
  • πŸ‡²πŸ‡©Moldova sc_cojocari

    Could it be because of wrong variables ?

  • πŸ‡³πŸ‡±Netherlands inascon

    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.

  • πŸ‡§πŸ‡ͺBelgium f2boot

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

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

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

  • Pipeline finished with Failed
    5 months ago
    Total: 390s
    #344196
  • Pipeline finished with Failed
    5 months ago
    Total: 571s
    #344201
  • Pipeline finished with Failed
    5 months ago
    Total: 255s
    #344212
  • πŸ‡±πŸ‡ΉLithuania k-l

    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)
    
  • πŸ‡¦πŸ‡ΉAustria mvonfrie

    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: πŸ› Path has unnecessary query appended. Fixed . I try to create a new patch by tomorrow.

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    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.

  • πŸ‡¦πŸ‡ΉAustria mvonfrie

    @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?

Production build 0.71.5 2024