plugins.inc Invalid argument supplied for foreach()

wxman - August 23, 2008 - 18:15
Project:Panels
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:sdboyer
Status:duplicate
Description

I'm trying the latest download for 6.x, and it seems to be almost there. I wish I could help more because I could really use it in two new sites I'm working on. I tried it using a couple of the standard themes just to be sure.

The first warning came at:
Missing argument 2 for panels_page_render_page_normal(), called in sites\all\modules\panels\panels_page\panels_page.module on line 179 and defined in sites\all\modules\panels\panels_page\panels_page.render.inc on line 90.
I seemed to fix it by adding the argument "$args" to line 179:
return panels_page_render_page_normal($loader_data['panel_page'], $args);

The second warning came after that fix:
Missing argument 2 for panels_page_save_display(), called in sites\all\modules\panels\panels_page\panels_page.admin.inc on line 784 and defined in sites\all\modules\panels\panels_page\panels_page.write.inc on line 28.
Again, the fix I did seems to work. I added the argument "$id" to line 784:
panels_page_save_display($panel_page, $id);

That left only one failure when I tried to make a test panel page. It seems to work until I go to the url of the page, then I get the title, followed by:
warning: plugins.inc Invalid argument supplied for foreach() in sites\all\modules\panels\includes\plugins.inc on line 855.
That one I just can't seem to make work yet. Like I said, I wish I could help more.

#1

wulff - August 26, 2008 - 13:54
Status:active» needs review

I experienced the same problems when testing the current HEAD revision.

The attached patch made it possible to create and view a panel page without any errors.

AttachmentSize
panels.patch 4.42 KB

#2

sdboyer - August 27, 2008 - 03:41
Status:needs review» closed

First off, let me just say that I really do appreciate the bug reports. However, there's a reason we haven't even released an alpha yet. The code is highly unstable, and merlin and I aren't documenting our TODOs anywhere except in back-and-forth IRC convos. We'll release an alpha when we're really prepared to start accepting patches. Generally speaking, trying to roll patches against HEAD is going to be an exercise in headache and futility, as the documentation is sparse, and I can't even guarantee that the documentation is necessarily up-to-date with respect to what functions actually do. About three-quarters of the suggestions here are a case-in-point -

@wxman: Panels for D6 is _not_ production ready, not even a little. I really wouldn't hold your breath if those projects need serious Panels work done anytime in the next month.

@wulff: your patch is interesting; though the inclusion of the !empty points to a different potential problem with the current logic, it's not the solution we need.

Again - the energy is GREATLY appreciated; just please wait until we have the alpha release!

#3

wxman - August 28, 2008 - 16:20

Thanks sdboyer.
I realize that it's not ready for prime time yet, and I know a lot of work is going into it. I'm just wishful thinking because it's the only module that I still needed to really do what I envision for the two sites I'm building. I'll come up with a work-around for now.

#4

renee - September 17, 2008 - 22:11

Ok, now that an alpha is out, can I report this bug? =)

I'm getting it still:

    * warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\drupal\modules\panels\includes\plugins.inc on line 1225.
    * warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\drupal\modules\panels\includes\plugins.inc on line 1123.

I have a content context and a piece of custom content. The %title isn't even getting through.

Update: It seems that uninstalling the Outline module fixed it. Odd.

#5

dan.crouthamel - September 18, 2008 - 20:14

I'm seeing the same thing with the current dev version, a simple panel with custom content.

    * warning: Invalid argument supplied for foreach() in /xxx/sites/all/modules/panels/includes/plugins.inc on line 1225.
    * warning: Invalid argument supplied for foreach() in /xxx/sites/all/modules/panels/includes/plugins.inc on line 1123.

#6

pisco23 - September 20, 2008 - 07:17
Status:closed» active

Hi - I'm going to stick my neck out a bit here and re-open this for the alpha version - since I am also seeing the same error messages, and, as with z allen above, I am not seeing the arugments being passed into the panels (%title, %0) etc... using the panels-6.x-2.x-dev.tar.

Patience is a virtue - I'll try and be virtuous :-)

#7

defconjuan - September 20, 2008 - 20:37

subscribe

#8

oren - September 20, 2008 - 23:27

hi,

here is a one liner patch that worked for me ....

panels/include/plugins.inc

***************
*** 1120,1125 ****
--- 1120,1126 ----
*/
function panels_context_get_keywords($contexts) {
$keywords = array();
+ if (!isset($contexts)) return NULL;
foreach ($contexts as $id => $context) {
if ($keyword = $context->get_keyword()) {
$keywords["%$keyword"] = $context->get_title();

#9

stodge - September 26, 2008 - 13:50

Ditto, same here.

#10

jbh2kplus - September 27, 2008 - 22:27

thanks oren! worked for me.

#11

lega - September 30, 2008 - 17:42

great worked for me too!

#12

sdboyer - October 1, 2008 - 18:27
Assigned to:Anonymous» sdboyer

FYI, this is on my radar to fix in the coming Panels work-time I've slated for this weekend. I haven't had a look at the proposed patch to see if it fixes the issue in the way it ought to be fixed, but my hunch is that it'll probably fall into the same category as wulff's patch - works for this case, but messes up other behaviors. In any case, I'll suss it out.

#13

sdboyer - October 7, 2008 - 00:31
Status:active» duplicate

oren's patch in #8 is NOT the right long-term solution. However, this has been fixed in -dev.

#14

his_dudeness - October 7, 2008 - 03:25

i get a "white screen of death" on installing the "-dev version". :-(

and i get

* warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/sitename/modules/panels/includes/plugins.inc on line 1225.
* warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/sitename/modules/panels/includes/plugins.inc on line 1123.

over and over again. i tried reinstalling the module, deactivating/deinstalling other modules, another theme ...

 
 

Drupal is a registered trademark of Dries Buytaert.