Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Jul 2009 at 07:20 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pingers commentedThis occurs when there are no modules left to install during the form submission.
I.e. the sort array isn't empty, but the new modules array is.
See the attached patch.
Comment #2
pingers commentedComment #3
pingers commentedE.g. if you don't have cURL support installed and try to enable simpletest, the bug will be triggered.
Comment #4
pingers commentedI made an oversight - it's not that no modules are installed, only that the arrays are different in size.
I.e. Previously, all selected modules are added to the $sort array regardless of being added to the $new_modules array (which contains modules that haven't failed validation).
I've tested conditions:
when there is only 1 module to enable, which fails validation.
when there is only 1 module to enable, which passes validation.
when there is multiple modules to enable, but some pass, some fail.
Comment #6
pingers commentedTry again... (testing)
Comment #7
pingers commentedComment #8
cburschkaI can't quite parse that comment. Was the comma supposed to be there?
Also, when referring to functions you append (), so this should be "array_multisort()".
I'm on crack. Are you, too?
Comment #9
jbrown commentedA few dupes of this issue:
#662950: array_multisort PHP warning when module failed to install
#660852: PHP warning generated if module fails hook_requirements() during enable
Comment #10
pingers commentedThe comment should probably read something like
"Only add modules that will be enabled to $sort. array_multisort() requires a matching number of elements."
Thoughts?
Comment #11
cha0s commentedMakes sense to me to put that comment above the else.
Comment #12
cha0s commentedComment #13
LT-1 commented#1: system.admin_.inc_.no-modules-to-install.patch queued for re-testing.
Comment #14
LT-1 commented#11: 523208.patch queued for re-testing.
Comment #15
jpmckinney commentedI came across this bug when I tried to enable the simpletest module without fulfilling its cURL requirement. I made the same patch as #11, except I prefer
if (condition) {) else {}toif (!condition) {} else {}. Also, with this re-ordering of the code, it's obvious just by reading it that we only wish to enable those modules whose requirements are fulfilled, and so there is no need for a comment.I'm RTBC's #11 although I prefer my idempotent patch.
Comment #16
jpmckinney commentedAdding tag.
Comment #17
pingers commentedLooks good to me (still).
Comment #18
klausidoes not apply anymore.
Comment #19
jpmckinney commentedHaving read the new system_modules_submit code, the reported warning when calling array_multisort should no longer be reproducible. Fixed by #592800-16: Dependent modules are still installed when required modules return errors in hook_requirements('install')