Closed (fixed)
Project:
MySite
Version:
5.x-2.11
Component:
- Layout plugin
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Aug 2007 at 21:33 UTC
Updated:
2 Oct 2007 at 23:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
agentrickardNot enough information provided to answer question.
This has been addressed before, so make sure you have the most current version.
http://drupal.org/node/153570
http://drupal.org/node/157164
Comment #2
agentrickardComment #3
agentrickardClosing due to lack of follow-up.
Comment #4
graysadler commentedI got this same error on line 27 layout/default.php. It happened when an item was removed from the page which left only one. When another item was added, the error went away. Let me know if you need any addl information.
Comment #5
agentrickardThere is still not enough information here. I have some suspicions.
Is the one item that was left part of the default content set? That is, the content pre-set by the administrator?
What user with what roles and permissions did this error occur for? Whose MySite page were they looking at?
A URL and test account would be helpful as well.
Comment #6
agentrickardAlso please confirm that you are using 5.x.2.8 by changing the Version in the issue.
Comment #7
agentrickardOne other question:
Does this _only_ happen with the default plugin? Have you changed your layout from a multi-column one?
My suspicion here is that you have content assigned to other page areas and it isn't collapsing properly when you reset to the default layout.
Comment #8
agentrickardOK, I was finally able to replicate this error. It happened when I did the following:
1) Selected the two-column layout.
2) Moved all content into the right-hand column.
3) Switched to the default layout.
There is probably an error in
mysite_prepare_columns().Can you confirm that you did something similar before this problem came up?
Comment #9
agentrickardTry this. Sorry for the lack of a proper patch.
Edit mysite.module, lines 769 - 779, function
mysite_prepare_columns():To:
I think that the
forloop did not execute correctly if the $set == 0.Comment #10
agentrickardMore testing. It's easier to replace the entire function
mysite_prepare_columns()THis will likely get committed to HEAD this weekend, since this is a bug.
Comment #11
agentrickardI ended up refactoring this code (again).
Comment #12
agentrickardA modified version of this fix has been rolled into the 5.x.2.9 release.
Nice catch!
Comment #13
tsavino commentedWhen I go to http://www.thesubculture.com/site/mysite when I pick Go to "user MySite page" I get these errors from each of the layouts and this happens with the default garland and litejazz but when I pick "Show list of all user mysites" there is no error these errors happen when the user is not loged in and on the access control I have "view all mysites" for "anonymous user" and made sure that they can view all content. these are the different panel choices
---------------------
Left Sidebar
A large main area with left sidebar:
warning: Invalid argument supplied for foreach() in /home/thesubc/public_html/site/modules/mysite/plugins/layouts/left.php on line 35.
---------------------
Two column
Two equal-width columns.
warning: Invalid argument supplied for foreach() in /home/thesubc/public_html/site/modules/mysite/plugins/layouts/columns.php on line 30.
-----------------------------------------
Basic layout
A single-column display of your personal content: No error
-----------------------------------------
Stacked two column
One main area and two equal-width columns:
warning: Invalid argument supplied for foreach() in /home/thesubc/public_html/site/modules/mysite/plugins/layouts/stacks.php on line 35.
warning: Invalid argument supplied for foreach() in /home/thesubc/public_html/site/modules/mysite/plugins/layouts/stacks.php on line 35.
----------------------------------------
Three Column
Three equal-width columns:
warning: Invalid argument supplied for foreach() in /home/thesubc/public_html/site/modules/mysite/plugins/layouts/triple.php on line 30.
warning: Invalid argument supplied for foreach() in /home/thesubc/public_html/site/modules/mysite/plugins/layouts/triple.php on line 30.
----------------------------------------
anything else you need let me know....
Comment #14
agentrickardHm. And you're running the most recent release?
Will test.
Comment #15
agentrickardIS the default content set empty?
Comment #16
agentrickardCannot confirm. See http://therickards.com/mysite/Bappsack for example.
This error occurs when an empty content array is accidentally passed to the layout files. The update to 5.x.2.11 should fix this.
Comment #17
tsavino commentedThats what the problem was a empty content array
Thanks for the help
Tom
http://www.thesubculture.com/
Comment #18
agentrickardRight, but there are safeguards that should prevent that error from being printed, so I'm still concerned.
If there is an empty content array, the code is supposed to handle it gracefully.
Comment #19
tsavino commentedHere is the error on another site I have
http://www.iamharmony.com/spirit/mysite/37/view
I only seem to happen when your not logged in, when I am logged in I do not get this error...
Comment #20
agentrickardI simply cannot replicate this error. See http://therickards.com/mysite/agentrickard
The 5.x.2.11 release was supposed to fix this problem. So please make sure you've updated to the latest version.
If you are on the latest version, I will need more information about user 37's data. A screenshot of the Content page would help (http://www.iamharmony.com/spirit/mysite/37/content).
The problem, which the cose described above should fix, is that you may have a multicolumn page with an empty column. If the columns aren't collapsed correctly, you get the invalid error.
Comment #21
tsavino commentedThe verison I am using:
----------------------------------------
; $Id: mysite.info,v 1.4 2007/06/18 23:50:54 dww Exp $
name = MySite
description = Allows users to create a custom page of site content.
package = MySite
; Information added by drupal.org packaging script on 2007-09-02
version = "5.x-2.11"
project = "mysite"
datestamp = "1188742810"
-----------------------------------------
The picture that is attached is the content when logged in.
Comment #22
agentrickardI'm finally seeing this error on another site, where they gave me admin access.
Do you have any Locked Content in the default content set?
Comment #23
agentrickardScratch that, locked content does not seem to be relevant.
Comment #24
agentrickardOK, I have managed to replicate this, but can you confirm:
This happens when the Default Settings are multi-region, but one of the regions is empty. See attached.
I should be able to fix this tonight.
Comment #25
agentrickardOK, I got it. If one of the regions is empty, right now we only fill it with content if yopu have certain permissions.
The attached patch corrects this behavior.
What I need from everyone is this:
The empty array should probably be replaced by a graceful theme function. What should that theme function present to the user?
Comment #26
agentrickardThis has been committed to HEAD and to 5--2 branch. When we have a good theme function, I'll roll a new release.
Comment #27
agentrickardFor reference, here's what happens now when the region is empty.
Comment #28
agentrickardThis has been released as-is in 5.x.2.12. Sorry no one stepped up to help.