Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I get the following notice:
Notice: Indirect modification of overloaded element of Drupal\Core\Template\Attribute has no effect in adminimal_theme_preprocess_html() (line 13 of themes/contrib/adminimal_theme/adminimal_theme.theme).
adminimal_theme_preprocess_html(Array, 'html', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
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) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 60)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I made the following patch to fix the problem.
Comment | File | Size | Author |
---|---|---|---|
#11 | theme-notice-2888527-11.patch | 743 bytes | asya_asina |
Comments
Comment #2
pdenooijer CreditAttribution: pdenooijer as a volunteer commentedComment #3
pdenooijer CreditAttribution: pdenooijer as a volunteer commentedRename the patch to the issue number.
Comment #4
melvinlouwerse CreditAttribution: melvinlouwerse at Ibuildings commentedpatch looks good and it solves the notice.
Comment #5
ANDiTKO CreditAttribution: ANDiTKO as a volunteer commentedThank you @pdenooijer!
I applied the patch but why you removed these lines? :
Comment #7
ANDiTKO CreditAttribution: ANDiTKO as a volunteer commentedGuys, now I get fatal error and whole administration is broken!! Even tried it on a fresh copy. I was unable to access the administration and check the watchdog so I did using drush.
I get:
error Error: Call to a member function addClass() on array in adminimal_theme_preprocess_html() (line 13 of /themes/adminimal_theme/adminimal_theme.theme)
Check this issue: https://www.drupal.org/node/2893202
Also I see that drupal core seven theme adds class like I did before. Check line 19 of seven.theme in drupal core :
I'm reverting this!
Comment #8
pdenooijer CreditAttribution: pdenooijer at Ibuildings commentedAh, it seems to be a difference between Drupal core versions...
I removed the use statement (boy scouting), because they are obsolete.
Comment #9
pdenooijer CreditAttribution: pdenooijer at Ibuildings commentedI made a more defensive patch that should fix both our problems :).
Comment #10
pdenooijer CreditAttribution: pdenooijer at Ibuildings commentedComment #11
asya_asina CreditAttribution: asya_asina as a volunteer and at DrupalJedi commentedThis patch don't work with current version of theme. I recreated patch with current code state.
Comment #12
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #14
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commented