Closed (fixed)
Project:
Panels
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2016 at 20:08 UTC
Updated:
12 Mar 2017 at 19:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Anonymous (not verified) commentedI get the same issue with 'Site Branding' block and module Context
Comment #3
redsky commentedI have a similar issue with when adding a "Site Branding" block, this message was in the log:
Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "theme" for route "system.theme_settings_theme" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 194 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Comment #4
szeidler commentedI also ran into the issue. For me it seems, that there is the problem, that the system is not aware of the theme, that should be used while placing it through panels. And the "Site Branding" block is tightly connected to the theme settings, because it defines the features and settings (e.g. logo) for the site branding block.
Context in in our case Panels don't know anything about the theme. And that's the big difference to the Block interface, where we always define the Block layout per theme.
I investigated the problem a little bit further and the source problem seems to be in
/core/modules/system/src/Plugin/Block/SystemBrandingBlock.phpline 76, where it tries to retrieveThat form value is only available in the block admin UI and returns therefore
NULLin all other contexts, like in Context or Panels. I tried to inject the "block_theme" setting into the "Add block" form from page_manager, but without any success.Workaround
If you stuck into that issue, you can use the following workaround:
/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php$theme = 'themename';Another approach would be to check the returned value
for
NULLand set the default theme. So like:But that hacking core…
Comment #5
edmargomes commentedszeidler create the patch with your solution, it's work for me. Thanks.
Comment #6
szeidler commentedHere is the requested core patch for those, who really need the workaround and can integrate the patch into their core update workflow.
In general the patch only needs to be applied in the moment you want to insert the branding block via page_manager/panels user interface.
If someone is interested to start a core issue on it, just reuse my investigation results. But I'm pretty sure, that it would require a more flexible solution (not just using the default theme as a fallback, but making the theme context selectable).
Comment #7
japerryComment #8
samuel.mortensonPretty sure we just need to add this code block from
\Drupal\block\BlockForm::formto our Panels IPE and Panels forms. I'll work on a patch.Comment #9
samuel.mortensonHere's a patch which provides a default value for block_theme, but I would agree that this is also a core issue and the branding block should prevent this error. I'm guessing the Context module will have to implement a similar fix.
One thing to consider is that modules like Page Manager can use Panels to display variants in different (non-default) themes, so we'll need to decide if this is urgent enough that we'll have to address that use case. We could do that in a follow-up issue as well.
Comment #10
japerryComment #11
hypertext200This appeared to fix the issue.
Comment #13
japerryCommitted #9