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

Irbis’s picture

The same problem. Please help!

Irbis’s picture

My 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?

spM-1’s picture

Firstly,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 :

stdClass Object ( 
          [tid] => 4 
          [vid] => 2 
          [name] => Category 1 
          [description] => Category 1 Description :D :) :D :)  
          [weight] => 0 
          [depth] => 0 
          [parents] => Array ( 
            [0] => 0 ) 
          [is_container] =>  
          [link] => /photography/?q=forum/4 
          [total_topics] => 1 
          [child_total_topics] => 0 
          [new_topics] => 0 
          [new_topics_text] =>  
          [new_topics_link] =>  
          [child_new_topics] => 0 
          [total_posts] => 2 
          [child_total_posts] => 0 
          [new_posts] => 0 
          [new_posts_text] =>  
          [new_posts_link] =>  
          [child_new_posts] => 0 
          [last_post] => sample topic by admin 2 hours 59 min ago 
          [icon_classes] => forum-list-icon forum-list-icon-default 
          [icon_text] => No new 
          [zebra] => even ) 

which is quite different :( and thats where is the problem !!

Am a bit busy as of now, would post a patch for this ASAP.

Irbis’s picture

Thanks, I'll wait.

eigentor’s picture

I 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.

Irbis’s picture

I 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

eigentor’s picture

I 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.

Irbis’s picture

Version: 6.x-2.0-beta1 » 6.x-2.0-beta3
Priority: Normal » Minor
Status: Active » Reviewed & tested by the community

Yes, it worked, thanks.

eigentor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.