With "Block Page (with Layout plugin)" module installed, I did the following:

  • created new page
  • clicked new variant button
  • selected "Block page (with Layout plugin integration)"

And after a brief loading animation, nothing happens. Exploring button action, I got the following info: It requests AJAX request to URL /admin/structure/page_manager/manage/arsti/add/block_page_layout?_wrapper_format=drupal_modal that in turn generates error

Recoverable fatal error: Argument 10 passed to Drupal\page_manager\Plugin\DisplayVariant\PageBlockDisplayVariant::__construct() must implement interface Drupal\Core\Extension\ModuleHandlerInterface, none given, called in /vagrant/app/web/modules/layout_plugin/modules/block_page_layout/src/Plugin/DisplayVariant/BlockPageLayoutVariant.php on line 78 and defined in Drupal\page_manager\Plugin\DisplayVariant\PageBlockDisplayVariant->__construct() (line 67 of /vagrant/app/web/modules/page_manager/src/Plugin/DisplayVariant/PageBlockDisplayVariant.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deele created an issue. See original summary.

Deele’s picture

Issue tags: +Page Manager, +Block Page
Deele’s picture

ademarco’s picture

I can replicate the error too, I'll provide a patch to fix it.

ademarco’s picture

Title: Invalid Drupal\block_page_layout\Plugin\DisplayVariant\BlockPageLayoutVariant::__construct() » Recoverable fatal error: Module Handler service not passed to PageBlockDisplayVariant constructor
Version: 8.x-1.0-alpha22 » 8.x-1.x-dev
Status: Active » Needs review
FileSize
3.3 KB

Apparently the Module Handler service was not passed to Drupal\page_manager\Plugin\DisplayVariant\PageBlockDisplayVariant::__construct(). This patch fixes it. I've also fixed tests which where breaking for a missing dependency.

bircher’s picture

Status: Needs review » Reviewed & tested by the community

The patch is green and manual testing confirms it working.

ademarco’s picture

Any news about this? Thanks!

Anonymous’s picture

I was able to replicate the error in a fresh Drupal 8.1 installation with the latest dev snap shot of layout_plugin. The patch in #6 fixed the problem for me.

criscom’s picture

I had the same issue on a fresh Drupal 8.1.3 install. Patch in #6 solved the problem for me. As of now, I haven't seen any undesired side effects of this patch.

Many thanks! Very much appreciated.

Anonymous’s picture

I found this to be a perfectly servicable module which meets a lot of my needs without jumping up to the next level of complexity and utility with Panels or Display Suite. If this module won't be maintained going forward as part of layout plugin module, please say so. In the meantime, my team is maintaining our own fork at https://github.com/caxy/blockpagelayout-module. Thanks for your work!

andypost’s picture

Confirm the bug and patch fixes the issue!
Would be great to release new stable version

Jeff Burnz’s picture

Priority: Normal » Critical

+1 patch works as expected, be great to see this committed. I concur with Bangpound that this is getting a little frustrating after five months of still having to apply the patch just to us Page Manager, it's holding up lots of projects and would be a massive improvement in the options we have to layout pages in D8.

Also this is a critical bug in the module, it's totally unusable without this patch.

dsnopek’s picture

Project: Layout Plugin (obsolete, use core's Layout Discovery) » Block Page (with Layout plugin)
Version: 8.x-1.x-dev »

As discussed on several issues (although, apparently not this one!), the 'block_page_layout' module was an example that was never intended to be used in production and we're going to remove it per #2653360: Remove BlockPageLayoutVariant and set example to hidden.

If you want to use Page Manager with Layout Plugin, then please use Panels!

However, since it appears that a couple people have started using 'block_page_layout' in production, I've created a new project on Drupal.org with a copy of the module:

https://www.drupal.org/project/block_page_layout

I don't intend to maintain that project, but if someone else wants to, please open an issue requesting ownership!

  • dsnopek committed c924882 on 8.x-1.x authored by ademarco
    Issue #2680351 by ademarco: Recoverable fatal error: Module Handler...
dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Comitted to the new repo! Thanks!

Jeff Burnz’s picture

Version: » 8.x-1.x-dev

If someone knows how to use Panels I'd love to hear it, because afaict there is no way to add "content" when using Panels, you get the General/Contexts/Selection Criteria but no Content option.

Thank-you for the new project, thats really great :)

[edit] I don't know why the version was set with my comment, odd?

Status: Fixed » Closed (fixed)

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