I get the error "The website encountered an unexpected error. Please try again later." after clicking on Demonstrate block regions (Clean Blog) under the Structure > Block Layout.

Steps to reproduce:
1. Installed drupal 8.6.7 using composer.
2. Installed Bootstrap base theme using the command $ composer require drupal/bootstrap
3. Above command installed Bootstrap 8.x-3.16 inside ./themes/conrib folder.
4. Enabled the bootstrap theme.
5. Downloaded the clean_blog-8.x-2.1.tar.gz from theme page on 'drupal.org'.
6. Installed it through Appearance>Install new theme.
7. Enabled the theme and set it default.
8. Went to structure > block layout. Clicked on the Demonstrate block regions (Clean Blog) link.
9. Getting the error "The website encountered an unexpected error. Please try again later." .

I am attaching the screenshot of the problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

altback created an issue. See original summary.

JayKandari’s picture

Assigned: altback » Unassigned
Issue tags: +Novice, +DIACWJuly2020

This is the error thrown:

Error: Call to a member function getPlugin() on null in clean_blog_preprocess_page() (line 31 of themes/contrib/clean_blog/clean_blog.theme).
clean_blog_preprocess_page(Array, 'page', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 450)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 109)
__TwigTemplate_02b63b3f3a6a46179f1da0458a32709f712e744b6b4dbb02fa8897ab3b00bda7->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 65)
twig_render_template('themes/contrib/bootstrap/templates/system/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
JayKandari’s picture

Version: 8.x-2.1 » 3.x-dev
rohittiwari’s picture

Assigned: Unassigned » rohittiwari

I can work on this @JayKAndari

rohittiwari’s picture

Demonstrate block regions loads the hook_preprocess_page, with generated inline_templates. The behavior which was coded in hook_preprocess_page would not work on the demo block page needed to handle it with proper validations. Created patch which takes care of validation

rohittiwari’s picture

Status: Active » Needs review
divya.sejekan’s picture

Assigned: rohittiwari » divya.sejekan
divya.sejekan’s picture

FileSize
14.06 KB
52.42 KB

@rohittiwari
Applied patch : demonstrate-block-regions-fix.patch , comment #5

Testing steps:
1. Install and set the theme
2. In Block Layout > Demonstrate block regions (Clean Blog)

Observation :
1. Issue of Demonstrate link not working - Fixed. Now the block layout is visible

Before applying patch:
before patch
After Applying patch:
after patch

Issue : All the regions in block layout are not highlighted , Only navigation region is highlighted.

divya.sejekan’s picture

Assigned: divya.sejekan » Unassigned
divya.sejekan’s picture

Status: Needs review » Needs work
sarvjeetsingh’s picture

Assigned: Unassigned » sarvjeetsingh
sarvjeetsingh’s picture

Assigned: sarvjeetsingh » Unassigned
Status: Needs work » Needs review
FileSize
2.58 KB
1.21 KB

updated patch to display used regions in block Layout.
please review.

rohittiwari’s picture

Assigned: Unassigned » rohittiwari
Issue tags: +DIACWSep2020

JayKandari’s picture

Assigned: rohittiwari » Unassigned
Status: Needs review » Fixed
Issue tags: -DIACWJuly2020, -DIACWSep2020 +DIACWOct2020

Looks good. Committed & pushed to 3.x. Thank you all for contributions.

Status: Fixed » Closed (fixed)

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