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.
Notice: Undefined variable: test in ctools_context_handler_get_render_handler() (line 70 of /path/to/sites/all/modules/ctools/includes/context-task-handler.inc).
Updated to the latest Dev (Oct 1st) and am now receiving this error.
Comment | File | Size | Author |
---|---|---|---|
#11 | ctools-1298332.patch | 895 bytes | jramby |
Comments
Comment #1
floleft CreditAttribution: floleft commentedTo remove the error for now, I added an isset() check for the variable inside the if($test). There may be a bigger issue though.
Comment #2
chriscalip CreditAttribution: chriscalip commentedI encountered the same problem with the situation of having installed panels then disabled panels; without removing the unnecessary module : page_manager from ctools.
Disabling page_manager solves the problems.
I think this solves this issue. Please turn it back to active if this is not the case.
Comment #3
chriscalip CreditAttribution: chriscalip commentedComment #5
jbateau CreditAttribution: jbateau commentedThe code has a bug. Reinstalling page_manager just causes the bug not to be hit.
old code:
should be:
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedInteresting.
Yes there is a minor bug here. What's more interesting is that the minor bug may have revealed a bug with a task handler somewhere. When you run into this bug, do you know what the $plugin that's being checked is?
Comment #7
jbateau CreditAttribution: jbateau commentedwell, I forgot about that. But the issue is that the code is simply wrong: the $test variable does not exist elsewhere in the function and therefore the code relies on it getting automatically initialized with false.
Which is Bad Practice and will cause this type of issue.
Comment #8
lhridley CreditAttribution: lhridley commentedThis appeared for me when I had the Panels module activated, and subsequently deactivated it. Activating Panels again caused the notice to go away.
Comment #9
wxman CreditAttribution: wxman commentedI was getting this using the 7.x-1.x-dev. The fix in #5 made it go away for me.
Comment #10
chrylarson CreditAttribution: chrylarson commentedI had the same situation as #8 and #5 fixed it for me as well.
Comment #11
jramby CreditAttribution: jramby commentedI created a patch from #5. Wish it really fix the problem :)
Comment #12
merlinofchaos CreditAttribution: merlinofchaos commentedComment #13
tim.plunkettThis makes the else statement match the above if statement, looks good to me.
Committed http://drupalcode.org/project/ctools.git/commit/06e628c.
@jramby, you should set up your git information. You got credit on that commit (see http://drupal.org/user/603140), but it looks weird on the commit page.
Comment #15
quinn.mckinsey CreditAttribution: quinn.mckinsey commentedAlright, taking merilinofchaos's advice I'll post my problem here, even though I'm having this issue with 7.x-1.0 and not 7.x-1.x-dev.
Here is the situation:
I have updated drupal core from 7.12 to 7.14. I disabled all modules before upgrading, which seems to have gone well. Now I'm trying to turn the modules back on. Enabling ctools and page manager gives the error. However, the solution given on #5 does not apply as the code in context-task-handler.inc on line 70 is already corrected.
Also, turning page manager off and back on does not fix the problem. Warnings do disappear when page manager is turned off.
Comment #16
quinn.mckinsey CreditAttribution: quinn.mckinsey commentedComment #17
quinn.mckinsey CreditAttribution: quinn.mckinsey commentedFurther update:
Enabling Panels causes the error to disappear and disabling Panels causes the error to return. Maybe, this has to do with an error on Panels part.
Hope this helps.
Comment #18
swentel CreditAttribution: swentel commentedLooks like the patch that committed introduced a new notice, patch over at #1566098: PHP notice: Undefined variable 'test' in ctools_context_handler_get_render_handler()
Comment #19
digibrill CreditAttribution: digibrill commentedPatch in #11 seemed to work for me.