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.
When going to /admin/build/modules/list/ you receiving following fatal error:
Fatal error: Cannot use string offset as an array in /modules/system/system.module on line 1439
I know that isn't correct url, but there shouldn't be any fatal error, you can't handle it with default error page.
$form_values = string 'list' (length=4)
--
if (!$module->status && $form_values['status'][$name] && isset($module->info['dependencies'])) {
So it mean that you can't use $form_values['status'][$name] when $form_values is a string.
Comment | File | Size | Author |
---|---|---|---|
#2 | system.module.patch | 1.03 KB | teezee |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedInteresting.
I verified that it does not affect D6.x nor D7.x.
Comment #2
teezee CreditAttribution: teezee commentedThis problem occurs when you visit the admin/build/modules/uninstall page before returning to the overview of installed modules in admin/build/modules/list. The *list* part is the problem here because it is passed as extra argument to the calling function (system_modules).
The system_modules function calls the confirmation form, which then calls the system_module_build_dependencies() where it all goes wrong.
Attached patch adds an extra check to the if statement, in the original situation only isset($form_values) is called, I've added an is_array($form_values) and another check inside the loop.
Please check the attached patch...
Comment #3
tomsolo CreditAttribution: tomsolo commentedi'm tested patch ok.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedBased on #3.
Comment #5
drummCommitted to 5.x. I wasn't able to reproduce the original issue, but more isset() and other checking is always good.
Comment #7
dharmanerd CreditAttribution: dharmanerd commentedFYI. Same problem here. D-5.3. Patch works.