Problem/Motivation
Ealier this month, we just upgraded Drupal from version 10 to version 11( the latest minor version at that time). I didn't checked website at that time, because this is local dev site. Today I launched the localhost and found that some of admin pages has Error messages above contents of the pages that should be debug mode things.
The messages are like bellow:
Error message
Warning: Undefined array key "bootstrap_styles" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "ckeditor5_plugin_pack" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "ckeditor5_plugin_pack" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "ckeditor5_premium_features" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "ckeditor5_premium_features" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "drupal" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "drupal" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "google_tag" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "google_tag" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "layout_builder_blocks" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "layout_builder_blocks" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "layout_builder_styles" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "layout_builder_styles" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "media_library_form_element" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "media_library_form_element" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "metatag" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "metatag" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "password_policy" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "password_policy" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "schema_metatag" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "schema_metatag" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "token" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "token" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "views_infinite_scroll" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "views_infinite_scroll" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
Warning: Undefined array key "views_slideshow" in Drupal\locale\LocaleProjectRepository->Drupal\locale\{closure}() (line 83 of core/modules/locale/src/LocaleProjectRepository.php).
This Error message is shown at some specific pages like below:
http://localhost/admin/config
http://localhost/admin/reports/status
http://localhost/admin/reports/translations (but not shown at http://localhost/admin/reports)
And /admin/reports/translations page says "All translations up to date."
I have already tried drush cr.
vendor/bin/drush locale:check command can make sure the existance of things listed on the Error message.
vendor/bin/drush php:eval "print_r(\Drupal::keyValue('update_available_release')->getAll());" command returns blank array.
AI I consulted says it should be bug of Drupal.
Any advise?
Steps to reproduce
This looks like locale and translation issue, so I recommend setting locale to non-English language (mine is Japanese).
Upgrade Drupal from 10.5.10 to 11.4.1. While upgrading them, composer conflict highly possibly occurs, so delete drush before upgrade and install it separately after upgrade.
Visit website and open http://localhost/admin/reports/status then you may found LocaleProjectRepository warning things.
Proposed resolution
Warings should be deleted from Admin panels.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3612028-9.patch | 1.16 KB | v.hilkov |
| #4 | スクリーンショット 2026-07-21 1.03.22.png | 434.13 KB | lionsea |
Issue fork drupal-3612028
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3612028-having-undefined-array
compare
Comments
Comment #4
lionsea commentedAnd I don't know how to hide this warnings from UI. I set "Error messages to display" to none at Logging and errors page, also set $config['system.logging']['error_level'] = 0; at settings.php of dev site.
Comment #5
cilefen commentedComment #6
nicxvan commentedDid you run database updates after updating?
This update should have cleared that out as far as I can recall.
Comment #7
lionsea commented@nicxvan
Yes I did, but I forgot that my exvironment has only mysql 5.7.39, so I can run drush updatadb but with warnings. Then I installed drupal/mysql57, so now drush updatadb returns only " [success] No pending updates." line.
I have still same issue at the pages of admin website.
Comment #8
lionsea commentedFor information, our hardware and OS is not compatible with mydql version 8. Due to certain circumstances, we do not plan to upgrade the hardware until a year from now. However, support for Drupal 10 ends this year. Therefore, we plan to address this issue using modules in the meantime.
Comment #9
v.hilkov commentedI also encountered this issue after upgrading one of websites to 11.4.4 I didn't had this warning during local development, only after I deployed it to test server. Couldn't find myself real reason for this, so I asked claude to find it, it told that happens because reading from an array while it is being sorted in place is undefined behaviour in PHP and can throw intermittent "Undefined array key" warnings. So I did patch that pre-computes weights in LocaleProjectRepository. Don't know if this is right fix or I just hide real problem but after I applied this patch warnings are now disappeared. I attached patch as well.
Comment #10
lionsea commentedHi, I updated the same site from 10.5.10 to 11.4 (it's 11.4.4 this time) again, and I had the same issue. Then I uploaded the website to prod site, then the warnings disappeared there. I still don't know the reason.
Comment #11
gaëlgI ran into the same bug. I had already run the database update. Patch #9 fixed the bug.
Comment #12
smustgrave commentedFixes need to be in MRs for review please.