- Issue created by @penyaskito
- πΊπΈUnited States mark_fullmer Tucson
Thanks for reporting this, @penyaskito. We do have test coverage for integration with the Dashboards module (see DashboardsIntegrationTest.php), and I just tested this using the latest version of Drupal 10 with Dashboards 2.1.7, and was able to successfully add blocks to a Dashboard, so I'm probably doing different steps than you provided. Here's my annotated version of the steps to reproduce, as originally stated.
- Enable layout_builder_restrictions and configure for view modes. Enabled. On /admin/config/content/layout-builder-restrictions , the "Entity View Mode" plugin is enabled.
- Install dashboard module (thas provides a section storage). installed. On /admin/config/content/layout-builder-restrictions, now the "Dashboards View Mode" plugin is enabled (automatically).
- Try to add a block to a dashboard, it will fail. On /admin/structure/dashboards/add , I create a new dashboard, and use the Block restrictions to suppress Views blocks. I save. I click "Personalize". I see the Layout Builder interface. I successfully add a Section. I try to add a Block. I see that there are no Views blocks listed. I successfully add the Dashboard-provided "Add content" block.
- πΊπΈUnited States ACoolDevDude California
Hello. I have run into this myself. To add to the original information, this is happening with the following versions:
Drupal 11.1
Dashboard 2.0.0
Layout Builder Restrictions 3.0.1 - Assigned to nidhish
- Status changed to Postponed: needs info
2 months ago 12:55pm 12 February 2025 - π―π΄Jordan Rajab Natshah Jordan
Facing the same issue in the following scenario:
Given that the Navigation and Layout Builder Retractions modules were enabled
When I go to"/admin/config/user-interface/navigation-block"
which is the Navigation blocks config page
And I click on"Add block"
in the navigation toolbar
Then I see the following messageError message
Oops, something went wrong. Check your browser's developer console for more details.When I open the browser debug tools
Then I see the following errorThe website encountered an unexpected error. Try again later. Error: Call to a member function getThirdPartySetting() on null in Drupal\layout_builder_restrictions\Plugin\LayoutBuilderRestriction\EntityViewModeRestriction->inlineBlocksAllowedinContext() (line 279 of modules/contrib/layout_builder_restrictions/src/Plugin/LayoutBuilderRestriction/EntityViewModeRestriction.php). Drupal\layout_builder_restrictions\Controller\ChooseBlockController->build() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 54) Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741) Drupal\Core\DrupalKernel->handle() (Line: 19)
- Merge request !37Issue #3491116: Fix inlineBlocksAllowedinContext() Not Checking for View Display in LayoutBuilderRestriction\EntityViewModeRestriction β (Merged) created by Rajab Natshah
- π―π΄Jordan Rajab Natshah Jordan
Attached a static
layout_builder_restrictions--2025-02-12--3491116--mr-37.patch
file from this point of MR37.
To be used with Composer Patches -
mark_fullmer β
committed 0bf571e5 on 3.x authored by
rajab natshah β
Issue #3491116: Fix inlineBlocksAllowedinContext() not checking for View...
-
mark_fullmer β
committed 0bf571e5 on 3.x authored by
rajab natshah β
- πΊπΈUnited States mark_fullmer Tucson
Thanks for adding the steps to reproduce, @rajab_natshah! The proposed new conditional check seems totally fine to accommodate edge cases in modules like Navigation and Layout Builder Retractions. Merged, with a new release on the way!
Automatically closed - issue fixed for 2 weeks with no activity.