Closed (fixed)
Project:
Advanced Forum More Styles
Version:
6.x-2.0-beta3
Component:
Miscellaneous
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2011 at 21:58 UTC
Updated:
5 Jan 2013 at 08:50 UTC
I get the following error message when I select "minimal":
warning: Invalid argument supplied for foreach() in sites/all/modules/advanced_forum_more_styles/styles/minimal/advanced_forum.minimal.forum-list.tpl.php on line 35.
Any ideas? Thank you!
Comments
Comment #1
Irbis commentedThe same problem. Please help!
Comment #2
Irbis commentedMy versions:
Advanced Forum 6.x-2.0-alpha4
Advanced Forum More Styles 6.x-2.0-beta1
These modules are not compatible with each other.
Anybody can help?
Comment #3
spM-1 commentedFirstly,I noticed the $forums variable which the template file advanced_forum.minimal.forum-list.tpl.php tries to use, doesnot exist after inspecting the variables passed to the template file by get_defined_vars() . We can fix that ofcourse, by adding a
$forums = $variables['tables'][1]['items'];
And this is enough to help you get rid of the php warning. But sadly thats not the end to the story.
The template file, expects a $forum object to be like :
* Each $forum in $forums contains:
* - $forum->is_container: Is TRUE if the forum can contain other forums. Is
* FALSE if the forum can contain only topics.
* - $forum->depth: How deep the forum is in the current hierarchy.
* - $forum->zebra: 'even' or 'odd' string used for row class.
* - $forum->name: The name of the forum.
* - $forum->link: The URL to link to this forum.
* - $forum->description: The description of this forum.
* - $forum->new_topics: True if the forum contains unread posts.
* - $forum->new_url: A URL to the forum's unread posts.
* - $forum->new_text: Text for the above URL which tells how many new posts.
* - $forum->old_topics: A count of posts that have already been read.
* - $forum->num_posts: The total number of posts in the forum.
* - $forum->last_reply: Text representing the last time a forum was posted or
* commented in.
But the actual structure of the $forum object there is :
which is quite different :( and thats where is the problem !!
Am a bit busy as of now, would post a patch for this ASAP.
Comment #4
Irbis commentedThanks, I'll wait.
Comment #5
eigentor commentedI created a new release (beta 2) that should fix the issue.
The template advanced_forum.minimal.forum-list.tpl.php did not match the latest version of advanced forum 6.2.x and had wrong variables like noticed by spM.
I had to redo some of the css since quite some classes had changed.
Should be fine now.
Please report back if the issue is fixed.
Comment #6
Irbis commentedI tried this release. It still does not work with the "Minimal" style.
Error:
warning: Invalid argument supplied for foreach() in /var/www/sites/all/modules/advanced_forum_more_styles/styles/minimal/advanced_forum.minimal.forum-list.tpl.php on line 35.
P.S. My versions:
Drupal core 6.25
Advanced Forum 6.x-2.0-alpha4
Advanced Forum More Styles 6.x-2.0-beta2
Comment #7
eigentor commentedI checked with a fresh installation and the error is not there.
The file advanced_forum.minimal.forum-list.tpl.php ist not even there anymore in the minimal style.
Please disable advanced forum more styles, disable advanced forum, uninstall advanced forum after that (not removing from the modules folder but going to the uninstall tab) so the database tables are removed.
Don't worry, it won't delete your forum posts, only the few advanced forum settings.
Clear cache.
Then enable both modules again and you should be fine.
By the way, use beta 3, I have found some design errors with icons and fixed them in beta 3.
Comment #8
Irbis commentedYes, it worked, thanks.
Comment #9
eigentor commented