I know you aren't updating 5.x any more, but that's the version I found this bug on so maybe it applied to 6.x too.

After changing to using advanced forum I noticed that the 'active' class is never applied to the cells in the sorted column of the topic list any more. It is only applied to the header. So our forum lost the nice background colour we apply to sorted columns.

I believe this is because you are calling tablesort_header() in advanced_forum_preprocess_forum_topic_list, but you never call tablesort_cell for the individual cells. Probably because you are using a template file to print the cells, whereas normal forum does it all in a function.

So I had to do the following to get it working:

In advanced_forum_preprocess_forum_topic_list():

// Create the tablesorting header.
$ts = tablesort_init($forum_topic_list_header);
$variables['sort'] = $ts['name']; // <<< Add that line

In advf-forum-topic-list.tpl.php template file you need to insert the active class in each cell (views count cell cannot be sorted) like so:

<td class="title<?php if ($sort == t('Topic')) print ' active';?>">

<td class="replies<?php if ($sort == t('Replies')) print ' active';?>">

<td class="created<?php if ($sort == t('Created')) print ' active';?>">

<td class="last-reply<?php if ($sort == t('Last reply')) print ' active';?>">

Sorry for no patch file.

Comments

michelle’s picture

It's not an issue in D6 and, yeah, I'm not dealing with D5 anymore. But I'll leave this open for a while to give 5.x users a chance to see it if they want to make the change.

Thanks for reporting,

Michelle

mr.j’s picture

Thanks and you're welcome

michelle’s picture

Status: Active » Closed (won't fix)

Cleaning queue.

Michelle

mr.j’s picture

Version: 5.x-1.x-dev » 6.x-1.1
Status: Closed (won't fix) » Active

Sorry to reopen this after such a long time but we just upgraded to 6.x-1.1 and as far as I can see this is still a problem.

There is nothing in advf-forum-topic-list.tpl.php to set a class on the table cells, and there is nothing in advanced_forum_preprocess_forum_topic_list either.

The problem is you kind of have to edit advanced_forum_preprocess_forum_topic_list and add the one line from my original post above instead of adding your own preprocess function to your template. If you do create your own preprocess function then you have to execute the whole header creation code again just so you can get the correct state before you add that one line.

michelle’s picture

Category: bug » feature
Status: Active » Closed (won't fix)

I checked core forum and it does not put the class on the td. It puts it on the header and AF does as well.

I added the line for you since it really doesn't hurt anything and keeps you from having to have a patched module but I'm not going to change the templates since you can do that in your own style.

Michelle

mr.j’s picture

Thanks Michelle.