Hi
When I'm trying go to forum I'm getting this error:

Fatal error: Unsupported operand types in /home/unitra/htdocs/6/includes/common.inc on line 1542

Comments

v8powerage’s picture

Title: forum doesn't works » forum doesn't works
Priority: Normal » Critical
v8powerage’s picture

Problem is in forum-list.tpl.php and topic-list.tpl.php

I changed this

      $rows[] = array
        (
        array('data' => $description, 'class' => 'forum'),
        array('data' => $forum->num_topics . ($new_topics ? '<br />'. l(format_plural($new_topics, '1 new', '%count new'), "forum/$forum->tid", NULL, NULL, 'new') : ''), 'class' => 'topics'),
        array('data' => $forum->num_posts, 'class' => 'posts'),
        array('data' => _forum_format($forum->last_post), 'class' => 'last-reply'),
        );

Into this

      $rows[] = array
        (
        array('data' => $description, 'class' => 'forum'),
        array('data' => $forum->num_topics . ($new_topics ? '<br />'. l(format_plural($new_topics, '1 new', '%count new'), array("forum/$forum->tid", NULL, NULL, 'new')) : ''), 'class' => 'topics'),
        array('data' => $forum->num_posts, 'class' => 'posts'),
        array('data' => _forum_format($forum->last_post), 'class' => 'last-reply'),
        );

But I'm getting printed %count new instead of 'number' new topics, and there is N/A instead last author.

fgm’s picture

Priority: Critical » Normal
Status: Active » Needs work

The change you are suggesting does not match the signature of function l() http://api.drupal.org/api/function/l/6

You are effectively invoking l('some plural title', array(...)), although the second parameter to l() is a path, like "forum/$forum->tid" in the current version.

However, there is indeed something fishy here since the current version passes three more parameters to l(), as it used to in D5, but this is D6 and l() only takes three parameters now. I don't have time to fix this for now, but you can at least try:

 array('data' => $forum->num_topics . ($new_topics ? '<br />'. l(format_plural($new_topics, '1 new', '%count new'), "forum/$forum->tid") : ''), 'class' => 'topics')

Although this loses the "new" attribute, it should resolve the problem you are encountering.

Removing criticality as this does not prevent the theme from working on essential pages.

v8powerage’s picture

Ok, I got advanced_forum module, and it's working ok now, perhaps it's worth to give a note about this.

fgm’s picture

Status: Needs work » Needs review

Seems to work in today's version.

fgm’s picture

Status: Needs review » Fixed

No objection after three weeks. Assuming problem fixed.

Status: Fixed » Closed (fixed)

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