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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pdenooijer created an issue. See original summary.

pdenooijer’s picture

Issue summary: View changes
pdenooijer’s picture

FileSize
592 bytes

Rename the patch to the issue number.

melvinlouwerse’s picture

Status: Active » Reviewed & tested by the community

patch looks good and it solves the notice.

ANDiTKO’s picture

Thank you @pdenooijer!

I applied the patch but why you removed these lines? :

use Drupal\Component\Utility\Xss;
use Drupal\Core\Form\FormStateInterface;

  • ANDiTKO committed 8fc5ae3 on 8.x-1.x authored by pdenooijer
    Issue #2888527 by pdenooijer: Notice: Indirect modification of...
ANDiTKO’s picture

Guys, 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 :

$variables['attributes']['class'][] = 'node-form-layout';

I'm reverting this!

pdenooijer’s picture

Ah, it seems to be a difference between Drupal core versions...

I removed the use statement (boy scouting), because they are obsolete.

pdenooijer’s picture

FileSize
763 bytes

I made a more defensive patch that should fix both our problems :).

pdenooijer’s picture

Status: Reviewed & tested by the community » Needs review
asya_asina’s picture

FileSize
743 bytes

This patch don't work with current version of theme. I recreated patch with current code state.

andrey.troeglazov’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Issue tags: +Adminimal Release 8.x-1.5

andrey.troeglazov’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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