The list of modules returned from _system_rebuild_module_data() has extraneous array keys with values that do not have an info property, which causes system_sort_modules_by_info_name() to throw notices
Notice: Undefined property: stdClass::$info in system_sort_modules_by_info_name() (line 917 of /Users/Ben/projects/d7/head/modules/system/system.admin.inc).
Despite the key for drupal_system_listing() being 'name' the modules ends up with elements like the following, where you can see that the dependency information is not merged into the skinr module because the keys differ:
[block] => stdClass Object
(
[uri] => modules/block/block.module
[filename] => modules/block/block.module
[name] => block
[info] => Array
(
[name] => Block
[description] => Controls the visual building blocks a page is constructed with. Blocks are boxes of content rendered into an area, or region, of a web page.
[package] => Core
[version] => 7.0-dev
[core] => 7.x
[files] => Array
(
[0] => block.module
[1] => block.admin.inc
[2] => block.install
[3] => block.test
)
[configure] => admin/structure/block
[dependencies] => Array
(
)
[php] => 5.2.4
[bootstrap] => 0
)
[type] => module
[status] => 0
[schema_version] => -1
[weight] => 0
[required_by] => Array
(
[dashboard] => Array
(
[name] => block
)
)
[requires] => Array
(
)
[sort] => 0
)
...
[sites/all/modules/contrib/skinr/skinr.module] => stdClass Object
(
[uri] => sites/all/modules/contrib/skinr/skinr.module
[filename] => sites/all/modules/contrib/skinr/skinr.module
[name] => skinr
[info] => Array
(
[name] => Skinr
[description] => Provides a way to define and/or skin bits of Drupal output from the UI.
[package] => Skinr
[core] => 7.x
[files] => Array
(
[0] => tests/skinr.test
)
[dependencies] => Array
(
)
[version] =>
[php] => 5.2.4
[bootstrap] => 0
)
[type] => module
[status] => 0
[schema_version] => -1
)
...
[skinr] => stdClass Object
(
[required_by] => Array
(
[skinr_ui] => Array
(
[name] => skinr
)
[skinr_test] => Array
(
[name] => skinr
)
)
[requires] => Array
(
)
[sort] => 0
)
This only happens during testing and if the module's test specifies the testing profile, it doesn't occur when you just visit /admin/modules on a standard profile install yourself.
To reproduce this:
1. Place a contrib module at sites/all/modules/
2. Comment out hidden = TRUE in profiles/testing/testing.info
3. Install Drupal
4. Visit admin/modules
5. See notices
Comment | File | Size | Author |
---|---|---|---|
#6 | 999072-drupal-system-listing.patch | 1.39 KB | Damien Tournoud |
Comments
Comment #1
sunCross-linking #985578: Duplicate key error in file registry when running tests using testing profile
Comment #2
sunThe question is who or what sets this bogus key:
Can you try to squeeze some debugging lines into [_]system_rebuild_module_data() in order to figure out at which exact point the bogus key is introduced?
Comment #3
coltraneafter drupal_system_listing() in _system_rebuild_module_data() we have
drupal_system_listing() get's the key 'name'
so I believe the problem is in this block of drupal_system_listing() where $key must be getting overridden.
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedSo this got broken by #895140: _system_rebuild_module_data() and _system_rebuild_theme_data() will choose 6.x versions of modules and themes over 7.x versions.
Comment #5
sunInterestingly, that was also my suspicion, even though I'm not able to see an error in that code.
However, the change that introduced the snippet you pasted was done only a few weeks ago, and around that time, the testing profile started to blow up.
Better title.
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commentedThe minimal patch is this.
Comment #7
sunInterestingly, David Rothstein already mentioned in a comment over there that "for some reason
$profile = 'testing'
can't be used anymore", which has been happily ignored. ;)Comment #8
sunhah, nice one! :)
I wonder whether it is possible to test this...?
Comment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedIt only blows in the testing profile because it's the only profile that has a modules directory with modules in it.
Comment #10
JacineI just tested and the patch in #6 fixes the problem. Thanks! :)
Comment #11
webchickHm. Would be nice if we could somehow test this but I can't really imagine a way to do it.
Committed to HEAD. Thanks!