Problem/Motivation

Error occurs when anonymous visitor clicks on link to missing page from ols serach results. Website becomes unavailable, WSOD.
themes/d8w3css/drupal8_w3css_theme.theme ligne 37

Steps to reproduce

Click on any non-exiostent page link

Proposed resolution

No fix

Remaining tasks

User interface changes

API changes

Data model changes

Comments

onewomanbiz created an issue. See original summary.

DawnFelagund’s picture

I'm getting the same error as a logged-in user when using an exposed filter block to filter results on a view of taxonomy terms.

The website encountered an unexpected error. Please try again later.
Error: Call to a member function bundle() on null in drupal8_w3css_theme_preprocess_html() (line 37 of themes/d8w3css/drupal8_w3css_theme.theme).
drupal8_w3css_theme_preprocess_html(Array, 'html', Array) (Line: 287)
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)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 2) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 2, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 2, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 2, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 2, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 2, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 2, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 2, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 2, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 2) (Line: 166)
Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber->makeSubrequest(Object, '/system/404', 404) (Line: 122)
Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber->on404(Object) (Line: 109)
Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase->onException(Object, 'kernel.exception', Object)
call_user_func(Array, Object, 'kernel.exception', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.exception', Object) (Line: 227)
Symfony\Component\HttpKernel\HttpKernel->handleException(Object, Object, 1) (Line: 79)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

flashwebcenter’s picture

Hello,
I updated the dev version. You can download it and it should have the latest updates.
https://www.drupal.org/project/d8w3css/releases/8.x-1.x-dev

Please make sure the Drupal core is updated to the latest recommended release.

Best wishes,
Alaa

flashwebcenter’s picture

Status: Active » Fixed
onewomanbiz’s picture

Assigned: flashwebcenter » onewomanbiz
Status: Fixed » Active

Yes, Looks pretty much like the codes I'm seeing. And it seems to be related alot to taxonomy terms as well.

drupalcare.com’s picture

Assigned: onewomanbiz » drupalcare.com
Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new374.76 KB

I'm a little confused by your comment...Please download the latest version and update your Drupal core to the latest release. The theme was tested for the latest release on 8 and 9.
Here is a taxonomy page https://drupal8-w3css-theme.flashwebcenter.com/drupal8-1

tax page

If you downloaded the updated version and you are still having trouble, please detail how you produced this error. Make sure to include Drupal core version and the modules.

fkelly12054@gmail.com’s picture

I have been seeing occasional PHP errors when a request is made for a "missing" taxonomy term. There is a lengthy PHP error message in my log, the core of which is:

#0 /home/fkelly5/public_html/drupal8/core/lib/Drupal/Core/Theme/ThemeManager.php(287): drupal8_w3css_theme_preprocess_html(Array, 'html', Array)
#1 /home/fkelly5/public_html/drupal8/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Theme\ThemeManager->render('html', Array)

and based on an input such as:

https://fkelly.org/drupal8/taxonomy/term/

This has been happening since the " 8.x-1.19 Stable release covered by the Drupal Security Team released 17 January 2021 ". Now it appears that it may be "fixed" by d8w3css 8.x-1.x-dev ... but there is very little detail about this. Looking at the code repository on Drupal.org I can't see what the changes are. Downloading the dev version and running file comparisons with the stable 1.19 release, it appears the changes are in the area of drupal8_w3css_theme.theme where the error is kicked off: particularly function drupal8_w3css_theme_preprocess_html(&$variables) {

I won't go any deeper into the coding weeds here, but it would be helpful to have more explanation of the changes. My file comparison also shows a number of other changes throughout the module code ... again no explanation as to what these are for.

I will probably try to dev changes on my production site to see if the problem goes away. IF it does, I'll report back.

Thanks for your quick action on "fixing" this but a bit more guidance would be helpful.

fkelly12054@gmail.com’s picture

I have (3/29/2021) copied the 8.x-1.x-dev version from a local testing site over to my production site. Initial indications are that everything is fine. The status report and available updates says that the recommended version is 8.x-1.19 (2021-Jan-17)

I guess that makes sense given that it is still the "stable" version. Still leaves an "unsettled" feeling. I will see if the occasional PHP error messages go away. I have tried to simulate the error by putting in a non-existing taxonomy term and the error doesn't happen ... I just get page not found ... which is what should happen.

onewomanbiz’s picture

flashwebcenter,
Thanks for the fix and updated theme version. I have installed it. I will report if errors continue to display but for now it looks good.
Note this is a Drupal 9 site.
onewomanbiz

fkelly12054@gmail.com’s picture

With 8.x-1.x-dev installed (both on a 9.1.5 site and an 8.9.13 site locally) the edit shortcuts for articles and views that previously showed when you brought up an article are gone. When I use another theme (even one that I have not customized the way I have the d8w3css theme) the shortcuts are still in place.

I will look further, thought I'd report this right away.

flashwebcenter’s picture

Thank you @onewomanbiz and @fkelly for your feedback. A new version was created with the new fix.
@fkelly, if you have a screenshot for the edit shortcuts for articles and views, that will be great.

Best wishes,
Alaa

fkelly12054@gmail.com’s picture

StatusFileSize
new87.05 KB
new371.72 KB

Okay. I restored d8w3css 8.19 on my localhost development system (that is running still Drupal 8.9.13) and did a screen capture. That file is 8.19.png. you can see the two little shortcuts to editing in the upper right corner of the screen. The page is generated by a view ... so there is an edit icon for the view and then right below that an edit icon for the first article content type. I noticed in generating the screen capture that the edit icons disappear if I move the mouse cursor off the article "area" on the screen ... thinking the icons must be generated by JS.

The second capture 8.1_dev.png is generated from my production system (fkelly.org) that is running the latest d8w3css dev version. The edit icons are gone. That system is running Drupal 9.1.15. But I don't think that matters ... with plain old d8w3css the edit icons worked just fine. Maybe a missing JS file? Or something to trigger them is missing?

flashwebcenter’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thank you @fKelly for the feedback. I think it is related to this issue https://www.drupal.org/project/d8w3css/issues/3206530.
Please download 1.21 and it you should see the links again.

Best wishes,
Alaa

Status: Fixed » Closed (fixed)

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

flashwebcenter’s picture