Closed (fixed)
Project:
Advanced Help
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2011 at 20:13 UTC
Updated:
12 Nov 2012 at 09:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerCan you give us any kind of information how to reproduce the problem?
One thing that would might help is to write dvm(views_trace()) in element_children with a if() wrapped.
So you could find out which function calls this.
Comment #2
tsvenson commentedTried to reproduce it on a fresh install, but couldn't. I have a db backup where it happens though which I can attach. It requires quite a few other contribs though...
Before I do that I could test the views_trace you mention, however i am not a coder so it would be great if you could explain how I do the if() wrapped your talking about. Would be great if you can give me the whole element_children function with that so I can just paste it in.
Comment #3
dawehnerShould be
You need devel module installed for this.
Comment #4
tsvenson commentedTried with adding your code, but it didn't output anything. Doesn't the views_trace() function require that the Views module is enabled first? This happens when I try to enable it.
Comment #5
dawehnerOh interesting.
It's really important that you give more context on your issues.
Take sure you try out to reproduce this bug on a clean drupal installation. The error could be caused by many other things.
Comment #6
tsvenson commentedThe only way I seem to be able to reproduce it is using a Backup and Migrate database that enables a bunch of modules. Then I simply try and enable the Views module only and that will trigger it. I have attached the database to this comment so you can test it.
You need the following modules and versions (they are all up-2-date when I post this):
Advanced help 7.x-1.x-dev (2011-Feb-25)
Backup and Migrate 7.x-2.1
Comment Notify 7.x-1.x-dev (2011-Feb-25)
Diff 7.x-2.0-beta2
Flexible Blogs 7.x-1.x-dev (2011-Feb-25)
Follow 7.x-1.x-dev (2011-Mar-10)
Gravatar integration 7.x-1.1
Token 7.x-1.0-beta1
Wysiwyg 7.x-2.0
Then you of course need the latest dev versions of Views and C-Tools as well.
Then simply do the following:
UID1 is: Admin/admin
I get the OP error when Drupal says that it needs to enable the ctools module. If I try with enabling them both at the same time there is no error on screen or in the error log.
I am using Acquia DAMP 1.2.33 localy on my Win 7 64bit when this is happening.
Comment #7
Letharion commentedThere's too many modules involved. I doubt someone else will be interested in digging through them all to find out which one causes the problem. You need to reduce the number of involved modules as much as possible, which will most likely be 1. And even then there's a major risk you'll be asked to file an issue with that module instead of Views.
Comment #8
tsvenson commentedWill see what I can do over the weekend. I'm no coder so I can only promise a trial and error search to limit things down. Just think it is a little strange that the error comes only when the C-Tools dependency kicks in. No other module with dependency like this showed similar error on that page, only Views.
Comment #9
brianhinkley commentedThis error occurs with other modules also.
I get this error when I enable a module that is dependent on another module that isn't enabled.
That error appears just before the the message...
You must enable the ***missing*** modules to install ***this-module***. (***fill in the blank***)
Would you like to continue with the above?
continue cancel
I haven't noticed any affect on the function of the installed modules after clicking continue and the installation completes.
There may be other instances where this occurs. I know I can duplicate it every time by enabling modules with dependencies.
Comment #10
Letharion commentedSo this might be a core issue, and it might not. With the information available at the moment, there is nothing we can do, and regardless, it's questionable at best whether or not this is Views related.
Comment #11
ansorg commentedI guess it's not views related at all. I run just into it. Fres D7 install, I started with minimal profile. Enabled some more modules but not yet Views. I didn't pay attention when the warning appeared the first time but now I have attached a debugger and I see that the following stack trace
the advanced_help.module.advanced_help_form_system_modules_alter sends a $form['modules'] to common.inc.element_children() which is undefined
move to Advanced Help?
Comment #12
ansorg commentedComment #13
dawehnerYes, move to advanced help.
Thanks! for provide a backtrace. This is great!!
Comment #14
skruf commentedThis patch checks the $form['modules'] variable is set before sending to common.inc > element_children().
Comment #15
yordan commentedIn function advanced_help_form_system_modules_alter(&$form, &$form_state)
$form['modules'] can be undefined.
What solves this problem for me is a simple check before executing the outer loop:
if (isset ($form['modules'])) {
foreach...
}
Comment #16
fietserwinProblem occurs when the modules list form gets back to ask permission to enable required modules. in that case there is no list of modules on the form. So the patch is the correct solution and works for me.
Only remark could be to also test if $form['modules'] is an array if it is set, but the context will probably ensure that it is either not set or it is an array.
Comment #17
pasqualleI can confirm this bug, and the patch is ok
Comment #18
eMPee584 commentedYes, the analysis is correct (empty form['modules'] on "Some required modules must be enabled" confirmation page) and the patch does work. But imho it's a little cleverer to exit the function straight away, also that way the indentation depth doesn't increase further -> no whitespace diff...
Comment #19
fietserwinThat's a matter of style and personal preference. Personally, I prefer the "1 exit point only" coding style (#14), but I don't care that much. e.g., if in the future you would want to alter another part of the form, you will have to revert to the way #14 does it anyway.
However, #18 is functionally equivalent to #14, so pick one and please commit it.
Comment #20
eMPee584 commented@fietserwin: well the difference it makes is
but your point's valid too so..
Comment #21
fietserwinGood catch. That function call should be in the if as well ... Reroll of #14. Please make your choice between #18 and #21 ...
Comment #22
rob c commentedBecause it's so darn close to the line #nr i'll try it here first:
Warning: Invalid argument supplied for foreach() in element_children() (line 6161 of [path]/includes/common.inc).
That's on D7.10, Advanced Help 7.x-1.0 and Advanced Help 7.x-1.x-dev 25 feb. 2011. (also have backup migrate installed, but that's really all)
I get the error when i try to install Pathauto 7.x-1.0 if i don't select token, it shows up on the confirmation page. If it's not related i'll dive into it if time permits and roll a separate issue, but first let's try here.
(so, clean install of drupal + contact, content translation, trigger, tracker core modules + backup migrate and advanced help Installed, then select pathauto and hit install)
Comment #23
fietserwin- Clarified title.
- #22: Probably the same, common.inc has been changed since the original report.
- Can someone else RTBC (latest patch is mine)?
Comment #24
petsagouris commentedThis works fine, thanks a lot.
Comment #25
kingfisher64 commentedI keep getting 6161 error on common.inc. I debugged this with some help and it was traced back to advanced help. The error used to pop up when a module was being installed. I'd click save and carry on and everything appears to be working fine. It got very annoying having to deal with this everytime a mod was enabled.
Since i've stopped using the module the error no longer pops up. I'd really like to be using the mod. Is there any plans to fix this?
I'd be willing to provide any info necessary. I was using 7.10 now i'm using 7.12 - and have not installed the mod with that yet.
Thanks
Comment #26
kingfisher64 commentedI'm getting different 6xxx thousand errors all to do with
common.inc.element_children()when installing other modules.Does the patches on #18 + #21 fix these error notices? If so could a new patched version of advanced help be released?
Comment #27
thatjustin commentedThis may be related: #1711256: Enabling disabled modules causes error: Invalid argument supplied to element_children()
Comment #28
twistor commentedWorks.
Comment #29
amitgoyal commentedThanks all! It's been moved into 7.x-1.x-dev.