Saving (and previewing) blocks with required contexts isn't currently working.

To reproduce:

  • Panelizer the default view mode on some content type
  • Visit a node page of that type
  • Try to place an "Title" block (in the "Content" category)
  • If you open the web developer tools and look at what was returned via AJAX, it's: {"message":"A fatal error occurred: Required contexts without a value: entity."}

Basically, what appears to be happening is that we're not saving the the context mapping for the block, and we're attempting to map the contexts before the configuration is applied (which is what should set the context mapping).

Working on a patch to fix now!

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new5.07 KB

I have a patch that fixes this for Panelizer, but actually not the Page Manager example in the issue summary. :-/ I believe that is still broken by #2636472: Load context for page that IPE is editing, rather than AJAX or form route

So, I'll update the issue summary to use Panelizer, because this fixes a legitimate issues.

dsnopek’s picture

Issue tags: +panelizer
phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/panels_ipe/src/Form/PanelsIPEBlockPluginForm.php
@@ -335,7 +356,7 @@ class PanelsIPEBlockPluginForm extends FormBase {
+   * @return \Drupal\Core\Block\BlockPLuginInterface

It should be BlockPluginInterface, not BlockPLuginInterface. The nittiest of nitpicks.

Other than that, this patch makes good sense to me.

dsnopek’s picture

StatusFileSize
new5.07 KB
new653 bytes

Thanks for the review! Here's a patch that fixes the type-o.

  • japerry committed dcfff0a on authored by dsnopek
    Issue #2665332 by dsnopek: IPE not saving context mapping (and trying to...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Fixed!

dsnopek’s picture

Woohoo, thanks!

The last submitted patch, 2: panels-ipe-context-blocks-2665332-2.patch, failed testing.

Status: Fixed » Needs work

The last submitted patch, 5: panels-ipe-context-blocks-2665332-5.patch, failed testing.

dsnopek’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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