Undefined array key in prepareUpdateData

Created on 17 March 2022, almost 3 years ago
Updated 7 August 2024, 4 months ago

Problem/Motivation

When i open "Available translation updates" page i get this error.
Drupal 9.3.8

Warning: Undefined array key "google_tag" in Drupal\locale\Form\TranslationStatusForm->prepareUpdateData() (line 214 of core/modules/locale/src/Form/TranslationStatusForm.php).
Drupal\locale\Form\TranslationStatusForm->prepareUpdateData(Array) (Line: 78)
Drupal\locale\Form\TranslationStatusForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('locale_translation_status_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Warning: Attempt to read property "info" on null in Drupal\locale\Form\TranslationStatusForm->prepareUpdateData() (line 214 of core/modules/locale/src/Form/TranslationStatusForm.php).
Drupal\locale\Form\TranslationStatusForm->prepareUpdateData(Array) (Line: 78)
Drupal\locale\Form\TranslationStatusForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('locale_translation_status_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Warning: Trying to access array offset on value of type null in Drupal\locale\Form\TranslationStatusForm->prepareUpdateData() (line 214 of core/modules/locale/src/Form/TranslationStatusForm.php).
Drupal\locale\Form\TranslationStatusForm->prepareUpdateData(Array) (Line: 78)
Drupal\locale\Form\TranslationStatusForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('locale_translation_status_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

same error for s3fs, metatag. is a module error?

Steps to reproduce

Enable italian and german language and go to Available translation updates

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Composer 

Last updated about 21 hours ago

No maintainer
Created by

🇮🇹Italy trickfun

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States RoloDMonkey

    TLDR:

    1. I was also able to make these errors go away by clicking on "Check manually".
    2. This might be a problem with how Drupal provides dev versions of modules via Composer

    I just saw this when checking /admin/reports/translations. Six modules threw this warning. In four cases, we required a dev version in composer.json. In one case it was a module that had not been in the codebase for months. I don't know how to explain that.

    For the four cases where we were pulling dev versions of modules, the .info.yml files did not have a project, for instance:

    name: Admin Toolbar
    description: Provides an improved drop-down menu interface to the site Toolbar.
    package: Administration
    type: module
    configure: admin_toolbar.settings
    core_version_requirement: ^9.2 || ^10
    dependencies:
      - drupal:toolbar
    
    

    In other cases, the project was added when pulling the module from Drupal, like so:

    name: 'Block Class'
    type: module
    description: 'Allows assigning the classes to Blocks.'
    package: User interface
    configure: block_class.settings
    core: 8.x
    core_version_requirement: ^8 || ^9 || ^10
    dependencies:
      - drupal:block
    
    # Information added by Drupal.org packaging script on 2022-12-26
    version: '2.0.11'
    project: 'block_class'
    datestamp: 1672065315
    
    

    The last case was CTools, which was surprising. It looks like our composer.lock file still thought that CTools was required by Pathauto, even though that is no longer the case, and we did not have CTools enabled.

  • 🇺🇸United States bobburns

    Please get this committed to core

    It works and the error comes with every core update after fixing it

  • 🇮🇳India onkararun

    @RoloDMonkey i have install Drupal 11.x version on DDEV v1.22.6 and php 8.3.0 and reproduce the same criteria, but i didn't get this error on that version.

  • 🇨🇦Canada smulvih2 Canada 🍁

    Solved the issue for my on core 10.2.5

  • Confirming that the patch in #7 worked to solve this issue for me.

    Additionally, I believe both https://www.drupal.org/project/drupal/issues/3310058 and https://www.drupal.org/project/drupal/issues/3422047 📌 Handle malformed module info in the translation status form Active are trying to solve the same issue seen here.

  • 🇨🇦Canada joseph.olstad

    @Arun.k I believe this is an error that occurs during upgrades rather than on fresh installs.

    When i open "Available translation updates" page i get this error.
    Drupal 9.3.8

    Just noticed this after upgrading to 9.4.10

    It works and the error comes with every core update after fixing it

    Solved the issue for my on core 10.2.5

Production build 0.71.5 2024