Problem/Motivation

When testing #3531523: Migration from Layout Builder (config only) with Sobki which has views blocks with contextual filters, this views block does not work:
- the entity context is not passed to the block.
- when configuring the block in Display builder it does not provide the options to set the arguments (while possible in Layout Builder)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

grimreaper created an issue. See original summary.

pdureau’s picture

grimreaper’s picture

Assigned: Unassigned » grimreaper
grimreaper’s picture

Encountered 4 other types of error when enabling DB on all Sobki's displays.

Warning: Undefined array key "block_content" in Drupal\display_builder_entity_view\Entity\LayoutBuilderEntityViewDisplay->buildThemeRegistryEntry() (line 542 of modules/contrib/display_builder/modules/display_builder_entity_view/src/Entity/EntityViewDisplayTrait.php).

Warning: Undefined array key "#information" in Drupal\webform\Element\Webform::preRenderWebformElement() (line 136 of modules/contrib/webform/src/Element/Webform.php).

TypeError: Drupal\display_builder_entity_view\BuilderDataConverter::convertFromLayoutBuilder(): Argument #1 ($sections) must be of type array, null given, called in /project/app/modules/contrib/display_builder/modules/display_builder_entity_view/src/Entity/LayoutBuilderEntityViewDisplay.php on line 130 in Drupal\display_builder_entity_view\BuilderDataConverter->convertFromLayoutBuilder() (line 71 of modules/contrib/display_builder/modules/display_builder_entity_view/src/BuilderDataConverter.php).

Warning: Attempt to read property "title" on null in template_preprocess_image_formatter() (line 60 of core/modules/image/image.field.inc).

Note for myself:

https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/types/manage/job_...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/block-content/man...
https://web-sobki-d11.docker.localhost/admin/structure/types/manage/blog...

grimreaper’s picture

Fixed LB conversion with empty section.

New one

Warning: Undefined array key "name" in template_preprocess_taxonomy_term() (line 66 of core/modules/taxonomy/taxonomy.module).

grimreaper’s picture

Status: Active » Needs work

Remaining warnings:

Warning: Undefined array key "#information" in Drupal\webform\Element\Webform::preRenderWebformElement() (line 136 of modules/contrib/webform/src/Element/Webform.php).

Warning: Attempt to read property "title" on null in template_preprocess_image_formatter() (line 60 of core/modules/image/image.field.inc). + other warnings related to image formatter.

grimreaper’s picture

Warning: Attempt to read property "title" on null in template_preprocess_image_formatter() (line 60 of core/modules/image/image.field.inc). + other warnings related to image formatter.

Comes from wrongly generated sample values, same problem in Layout Builder.

pdureau’s picture

if you finish this week, you can move it to beta1 scope

grimreaper’s picture

grimreaper’s picture

For contexts.

In Block layout and in Layout Builder, it is coming from app/core/lib/Drupal/Core/Block/BlockBase.php

  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    ...
    $form['context_mapping'] = $this->addContextAssignmentElement($this, $contexts);
    ...
  }
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Needs review

Until context handling is discussed, current MR ready for review for the fixes it brings.

grimreaper’s picture

Assigned: Unassigned » grimreaper
grimreaper’s picture

Status: Needs review » Needs work

WIP on context mapping. now there are the form elements but it is not saved.

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Needs review

Thanks @pierre for the meet ;)

To review :)

grimreaper’s picture

mogtofu33’s picture

Assigned: Unassigned » mogtofu33

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

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

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

Maintainers, please credit people who helped resolve this issue.

grimreaper’s picture

Thanks for the merge \o/

Don't forget to "save" the issue credits on https://new.drupal.org/contribution-record/11422605, tickling the checkboxes is not enough (I encountered that too, the time to take this new habit ;))

Status: Fixed » Closed (fixed)

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