Problem/Motivation

When I call mydomain.de//de/admin/modules i get an error message:

Call to a member function addClass() on array in claro_preprocess_form_element() (Zeile 783 in /www/htdocs/web/core/themes/claro/claro.theme).

Steps to reproduce

TBD

Proposed resolution

For the moment i helpted me with comment this line:

$variables['description']['attributes']->addClass('is-disabled');

So i could get activated Open Graph from Meta Tag.

I can not say, if the error comes with core ore an other module.
Until today I installed all modules with composer and activated with drush, so i never tried calling this page before.

TBD proposed solution needs to be cleaned up.

Remaining tasks

Update issue summary
Add tests
Review

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

Comments

Lissy created an issue. See original summary.

nivethitha’s picture

Assigned: lissy » nivethitha
Status: Active » Closed (works as designed)

I am not get this type of issue on this version. Please check it once again.

johnnydarkko’s picture

Status: Closed (works as designed) » Needs work
StatusFileSize
new1.1 KB

I'm getting this error, too, and it's quite annoying. I can't do anything unless I hack the `claro.theme` file. Even when the 'Proposed Solution' is done, I'm getting this error that appears to be related, except my error says 'null' instead of 'array':

Error: Call to a member function addClass() on null in claro_preprocess_links__action_links() (line 1245 of core/themes/claro/claro.theme).

call_user_func_array('claro_preprocess_links__action_links', Array) (Line: 285)
Drupal\Core\Theme\ThemeManager->render('links__action_links', Array) (Line: 445)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 194)
__TwigTemplate_10df5664077d83d1951875e752383543->doDisplay(Array, Array) (Line: 394)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
Twig\Template->display(Array) (Line: 379)
Twig\Template->render(Array, Array) (Line: 40)
Twig\TemplateWrapper->render(Array) (Line: 53)
twig_render_template('themes/contrib/gin/templates/system/system-themes-page.html.twig', Array) (Line: 372)
Drupal\Core\Theme\ThemeManager->render('system_themes_page', Array) (Line: 445)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 458)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 239)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
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(Object, 'kernel.view') (Line: 187)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I created a patch that checks to see if the `attributes` key exists before invoking `addClass`, but this feels like there's something else that has gone awry...

johnnydarkko’s picture

Status: Needs work » Needs review
smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs steps to reproduce, +Needs tests, +Needs Review Queue Initiative

Added the issue template but there are sections that need to be filled in, mainly steps to reproduce and an agreed solution.

Will need a test case also.

sijumpk’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

@johnnydarkko, Normally going to /admin/modules (as said in the issue summary) is not making any errors. Maybe some custom/contributed module's links are generating the problem. Try to recreate the problem by disabling all non-core installed modules.

smustgrave’s picture

Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)
prashant.c’s picture

Issue summary: View changes

Attempted to replicate the issue on versions 10.1.x and 11.0.x by introducing the German language and exploring various pages, including /admin/modules. However, I was unable to encounter the error. @nivethitha, it would be appreciated if you could provide instructions on how to reproduce this issue. Thank you.

prashant.c’s picture

akshayadhav’s picture

Assigned: nivethitha » Unassigned
johnnydarkko’s picture

Turns out the issue was due to some bad custom code in a custom module overriding link text in an implementation of hook_preprocess_links for a link that doesn't exist in the variables array of the admin pages that were whitescreening for me. So, the case I described earlier (#3) isn't a valid report and patch, but I'll leave this all here just in case it helps someone else making the same bonehead mistake :)

johnnydarkko’s picture

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Not deleting the issue just moving to a different bucket.