MySite throws an error when there is no content on the page. It doesn't happen 100% of the time, but it usually does. It happens when there's default content that's all deleted by the user, and when there's no default content.
This is the error:
warning: Invalid argument supplied for foreach() in [site]/public_html/modules/mysite/plugins/layouts/default.php on line 29.
I'm not sure exactly why that error appears, but if it's not really used for anything I feel like it should just cause the "you haven't added content to this page yet..." text to show up.
Is the 5.x-3.0B3 version stable yet? If so, I might consider using that instead. I'm running a production site but it's a startup (my first of this magnitude) and I didn't launch with a user base so there are only some 10 users on the site right now. (Note to self: don't do that next time. ;) )
Comment | File | Size | Author |
---|---|---|---|
#9 | mysite_cache.patch | 3.16 KB | agentrickard |
#4 | MySite Error.png | 47.96 KB | IceCreamYou |
#2 | Picture 2.png | 13.82 KB | agentrickard |
#2 | Picture 3.png | 49.59 KB | agentrickard |
Comments
Comment #1
agentrickard5.x3-beta3 had some bugfixes. HEAD should be stable, but I have not had enough testers in order to confirm that it can be released. So testing HEAD would be greatly appreciated. I can't release until people test.
Back to this bug. Let me make sure I understand.
-- The admin sets default content.
-- A user creates MySite page.
-- The default content is placed on the user MySite page.
-- User then deletes all content.
-- User goes to 'mysite/UID' and gets and error.
Correct? We have fixed some variant of this bug at least 5 times, so I need to know precisely the situation.
-- Who is viewing the page? The owner? An anonymous user?
Comment #2
agentrickardHere's what I did:
-- Set default content items.
-- Created a new user MySite page.
-- Deleted all content from the user 'View' page.
No errors. Screenshot attached (picture 2).
-- Added content again.
-- Deleted all content from the user 'Content' page.
Again, no errors. (picture 3).
Are you certain that you are using the latest release?
Comment #3
agentrickardMost recent release should have this at the top of the CHANGELOG.txt:
Comment #4
IceCreamYou CreditAttribution: IceCreamYou commentedIt is the newest version of the 2.x branch, and has the text in the changelog that you indicated.
I have noticed this error twice.
The first time, I (the admin) had set no default content, and an authenticated user got the error each time he viewed his mysite page until content was added.
The second time, I had set default content. An authenticated user then edited his mysite page (for the first time--it started with the default content) and removed all content from the page. Upon doing so, he was taken to a screen that looks similar to your Picture 2.jpg. However, on refresh, the page showed up like the attachment to this post. This result was achieved both by deleting content from the View tab, and by deleting content from the Content tab.
If it would help, I can email you the username and password for a test user so you can try it yourself if you can't duplicate the results on your own.
Comment #5
agentrickardTried again on a different machine with a totally fresh install of the 5.x.2.17 module.
Cannot replicate; everything works as expected.
Do you have Drupal's cache turned on? MySite's cache turned on?
Comment #6
agentrickardIt seems to be the MySite cache that is the problem. Disable it for now while I find a solution.
Comment #7
agentrickardPatch coming shortly.
Comment #8
agentrickardComment #9
agentrickardThis bug has apparently been around since the first release, and you're the first person to catch it.
The information about "second page load" was crucial in figuring this out.
Patch attached, committed to HEAD. Give yourself a gold star!
Comment #10
IceCreamYou CreditAttribution: IceCreamYou commentedHaha. Thank you for making it work! This is a great module.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.