Whenever I try to use a custom layout, it throws up errors when switching to the custom layout, then it throws up more errors when trying to add content to the custom layout. The add content page is blank below the "Title" field, so there is no way to add content.
Steps to reproduce:
- Go to: Structure > Panels > Create New... > Custom Layout > Add Flexible Layout
- Give the layout a name, but leave everything else as default
- Go to: Structure > Panels, and edit an existing panel page
- Try to change the layout of the panel page to the custom one that was just created. This causes the following error messages:
Notice: Undefined index: items in panels_flexible_panels() (line 255 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_panels() (line 255 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc). - Click update and save.
- Try to add content to the layout, which produces the following error messages:
Notice: Undefined index: items in panels_flexible_panels() (line 255 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_panels() (line 255 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Notice: Undefined index: items in panels_flexible_render_css() (line 729 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_get_css_group() (line 810 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Notice: Undefined index: items in panels_flexible_get_css_group() (line 910 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_get_css_group() (line 921 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Notice: Undefined index: items in theme_panels_flexible() (line 389 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_render_items() (line 457 of /Users/tom/Sites/drupaltd/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Comment | File | Size | Author |
---|---|---|---|
#44 | panels_flexible-panel-flexible-warning_fix-1106302-44.patch | 969 bytes | Koen.Pasman |
#42 | panel_flexible-panel_flexible_warning_fix-1106302-42.patch | 971 bytes | AaronA |
Comments
Comment #1
bradspry CreditAttribution: bradspry commentedI'm seeing practically the same thing using 6.x-3.9.
Make a new custom layout, leave all the defaults, save.
Create new panel page, choose the new custom layout, foreach() errors appear.
* warning: Invalid argument supplied for foreach() in /sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 256.
* warning: Invalid argument supplied for foreach() in /sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 798.
* warning: Invalid argument supplied for foreach() in /sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 909.
* warning: Invalid argument supplied for foreach() in /sites/all/modules/panels/plugins/layouts/flexible/flexible.inc on line 444.
I believe the issue is in the defaults. When you change the defaults, say add a region and save, no errors.
Comment #2
drupov CreditAttribution: drupov commentedsubscribe
Comment #3
FreeFox CreditAttribution: FreeFox commentedI seem to have the same problem with the latest 7-dev release too:
Warning: Invalid argument supplied for foreach() in panels_flexible_panels() (line 255 of /.../all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_get_css_group() (line 810 of /.../all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_get_css_group() (line 921 of /.../all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_render_items() (line 457 of /.../all/modules/panels/plugins/layouts/flexible/flexible.inc).
Notice: Undefined index: items in panels_flexible_panels() (line 255 of /.../all/modules/panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_panels() (line 255 of /.../all/modules/panels/plugins/layouts/flexible/flexible.inc).
Please help
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedThis patch should fix the issue.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedNot really major. It has an easy workaround: Change the settings on your new flexible layout. :)
Comment #6
FreeFox CreditAttribution: FreeFox commentedThanks alot merlin, indeed, creating a new layout, saving, open again, change something and save again works :)
Thanks
FreeFox
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to D6 and D7.
Comment #8
FreeFox CreditAttribution: FreeFox commentedMerlin, just tested the patch and all issues are gone, works like a charm now ^^
Greetz
Freefox
Comment #9
FreeFox CreditAttribution: FreeFox commentedComment #11
somatics CreditAttribution: somatics commentedHi,
I have this exact symptom, except the solution in this post did not work.
I installed the latest Dev version of the module, which appears to be the one that includes Merlin's fix from Sept 20. I checked line 258 of the file and it contains the newer code.
However, I am still continuing to get the same error messages any time any flexible layout panel is accessed.
I don't know if I'm following the instructions correctly: I made changes to panel content settings (e.g., a CSS tag and a style setting on several panes), and saved.
I went to basic settings and changed the title and url, and saved. I went to Layout Designer and saved settings.
Is there any other news or insight on this issue?
Comment #12
somatics CreditAttribution: somatics commentedI am *still* getting this error -- it floods my error logs 24/7. Can someone please tell me what do?
I am running Drupal 7.9 and the latest dev of Ctools and Panels. I have opened the offending layout and made a change in the layout designer and saved it. Still get the error message. I don't know if I'm just not understanding what you guys are saying to do to fix it, but I would really appreciate it if you could help.
Thank in advance!
Comment #13
Letharion CreditAttribution: Letharion commented@merlin Looks like the issue could use your attention.
Comment #14
Letharion CreditAttribution: Letharion commentedClarifying that it's flexible layouts, not a custom.
Comment #15
merlinofchaos CreditAttribution: merlinofchaos commented#11 posted getting "the error" but there's a wide variety of errors reported above and #11 isn't the author of any of them. Please specify exactly what error you are receiving.
Comment #16
somatics CreditAttribution: somatics commentedSorry, @merlinofchaos, for not specifying; here goes: I'm getting the following error when I display a panel page that uses a flexible layout:
Notice: Undefined index: type in panels_flexible_panels() (line 258 of /path-from-server-root-to-drupal-folder/drupal-folder/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
Comment #17
Letharion CreditAttribution: Letharion commentedComment #18
somatics CreditAttribution: somatics commentedDoes this being transferred away from merlinofchaos to anonymous mean the issue is not going to be addressed?
I provided the info he requested, but I didn't change the status from "postponed (maintainer needs more info)" to "active" until now.
Comment #19
merlinofchaos CreditAttribution: merlinofchaos commentedHm. That error isn't the same as on that was gotten previously; I say this just to emphasize that when posting about bugs, being precise matters a lot. We are unable to guess at what you're seeing.
It's probably a different error. It indicates that the layout contains a section with no 'type' which I've never encountered before.
Can you export your panel with the layout (or layout if this is a reusable layout, it's not clear) so that I can see the definition?
Comment #20
somatics CreditAttribution: somatics commentedI completely agree with you about being precise; I do try to do that, including here, but it appears I overlooked that mine said "type" where the initiating post said "item", or perhaps when I posted I didn't understand this as a defining difference.
Anyway, here's the entire panel page export data:
FYI in case this is meaningful -- this page was not upgraded from from D6 to D7; after we upgraded the whole site from D6 to D7, we actually created this page anew in D7.
Comment #21
merlinofchaos CreditAttribution: merlinofchaos commentedInteresting! THis layout is borked a little:
So, those are incomplete entries in the list of items in the layout.
They shouldn't exist. Other than the type message, they're probably harmless. You can remove this by exporting the handler, removing those lines, and re-importing the handler. Should work pretty easily. You'll possibly have to delete the layout first, so backup your database just in case something goes wrong.
The real question is, how did they get there? Do you happen to remember if something funky happened when adding/editing/removing an item named "social column"?
Comment #22
somatics CreditAttribution: somatics commentedThanks! I exported the panel code, deleted it, and imported it back. I don't know for sure or not, but it appears the error may be gone for that page! :)
That's the good news. The bad news is that I am still getting the same error on another panel page:
Notice: Undefined index: type in panels_flexible_panels() (line 258 of /path-from-server-root-to-drupal-folder/drupal-folder/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc).
How would I determine what is bad code in that panel, to know what to delete from it like you advised on the other panel page?
Comment #23
somatics CreditAttribution: somatics commentedYou asked if something funky happened with the panel. To that end of trying to determine if there's a larger bug, unfortunately, I don't have much: I don't recall there being anything odd that happened when creating the first panel page.
I can tell you it was created new in Drupal 7, after upgrading the whole site from Drupal 6. It was around August 2011, and I was using the latest dev versions of things like Ctools, Panels, & Views.
Regarding the other page I just told you about that is also reporting the same error as the first one was -- that page was one that already existed in the Drupal 6 before upgrade.
Comment #24
somatics CreditAttribution: somatics commentedOne more item, which may necessitate a new issue post; however, in case it bears on troubleshooting or solving this thread, in the interest of insight as well as not clogging up the forums with fragments of issues, I'm going to start by reporting it here:
After fixing the code as per your instructions on the first panel I discussed, that first panel is instead now frequently showing the following error:
Is this related? And how do I get rid of this one?
Comment #25
merlinofchaos CreditAttribution: merlinofchaos commentedHmm. That missing pipeline is very odd. You can probably fix it by going to the general settings tab, submitting that form and then saving.
The giveaway on what's wrong is that those bits of the array are missing a 'type' keyword. If you look at all of the others, they're each describing a part of the layout. Either a row, column, region or the canvas. Anything without a 'type' is something that was somehow erroneously put in there.
Comment #26
Mario Baron CreditAttribution: Mario Baron commentedI've been getting the same errors so I tried different things. First was to go to panels>>settings and uncheck flexible layout from allowed layouts list. That did not work and it was kind of weird that it wouldn't since I already disabled flexible layout so I dug deeper...
I then disabled display suite module and bingo errors disappeared. Funny thing is that I wasn't using flexible layout at all, with display suite or elsewhere. I was using responsive layout for panel responsive layouts module.
I have the latest dev version of panels which contains the patch from #4 and latest dev version of layout module installed and display suite 2.4, after update to 2.6 errors persist.
This seems to be related to https://drupal.org/node/1732914 but looks like that thread has been dead for the past year
Comment #27
Mario Baron CreditAttribution: Mario Baron commentedAfter some more digging I found code within ds relating to flexible layout in /ds/includes/ds.registry.inc on line 508
perhaps this is something merlin could look at as my guess is there is some kind of a communication error with DS here
Comment #28
freality CreditAttribution: freality commentedI just ran into this issue on a new project. After digging into flexible.inc, I noticed
panels_flexible_convert_settings
exits early without testing if$settings['items']
is set. Soelse if (!isset($settings['items']))
at line 136 can never be reached.This patch simply tests
isset($settings['items'])
before exiting early.This patch is built against the 7.x-3.x branch.
Comment #29
meba CreditAttribution: meba commentedConfirmed patch fixes the issue
Comment #30
Mario Baron CreditAttribution: Mario Baron commentedConfirming patch in #28 fixed the issue for me
Comment #32
Håvard CreditAttribution: Håvard commentedAfter applying patch in #28 i receive following error message:
Notice: Undefined index: rows i panels_flexible_convert_settings() (line 207 av /.../modules/panels/plugins/layouts/flexible/flexible.inc).
Comment #33
criscomI can confirm #32. Same error after applying patch #28.
Comment #34
Alauddin CreditAttribution: Alauddin commentedinstall of DS 7.x-27 gave me the following errors
Notice: Undefined index: items in panels_flexible_panels() (line 257 of /panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_panels() (line 257 of /panels/plugins/layouts/flexible/flexible.inc).
Notice: Undefined index: items in panels_flexible_panels() (line 257 of /panels/plugins/layouts/flexible/flexible.inc).
Warning: Invalid argument supplied for foreach() in panels_flexible_panels() (line 257 of /panels/plugins/layouts/flexible/flexible.inc).
confirming patch in #28 worked on 7.x-3.4 (not the dev) version.
***sorry jumped the gun too soon, errors persist*******
Comment #35
WebWalker3D CreditAttribution: WebWalker3D commentedConfirming #32, same error after applying patch in #28. Any insight?
Comment #36
AlfTheCat CreditAttribution: AlfTheCat commentedPlease have a look at #4 of this issue: #1732914: DS + Flexible Panels
In my case I was using the layout module, the two patches (even for a later version) to DS and Layout fixed my errors.
Comment #37
Yuri CreditAttribution: Yuri commentedpatch #28 applied, but not working on dev. I don't use DS
Comment #38
Yuri CreditAttribution: Yuri commentedComment #39
drupwash CreditAttribution: drupwash commentedSmall fix included in patch for 7.x because I'm having same issue.
Comment #40
drupwash CreditAttribution: drupwash commentedComment #41
drupwash CreditAttribution: drupwash commentedFix again
Comment #42
AaronA CreditAttribution: AaronA commentedI'm also having this issue, but drupwash's patch fixed it, after I fixed the patch. Rerolled patch against 7.x-3.x branch.
Comment #44
Koen.Pasman CreditAttribution: Koen.Pasman as a volunteer commentedRerolled patch against 7.x-3.x branch.