Last Post's Title is first post's
Time posted and poster name is correct as the last post's.

I see it on your Demo site as well.

Comments

michelle’s picture

Title: Last Post's Title is first post's » Last post link on forum overview not caching properly
Assigned: Unassigned » michelle

Changing the title so I can remember what this is. I'll fix it. Thanks for letting me know. I clear the cache so much while devving I missed it.

Michelle

maulwuff’s picture

a dirty workaround would be in advanced_forum.module:

~line 634

change
function advanced_forum_get_all_last_topics($reset = FALSE) {

to
function advanced_forum_get_all_last_topics($reset = TRUE) {

(this is for v5 alpha3)

similar one:
http://drupal.org/node/222212 (v6)

michelle’s picture

Just an FYI for anyone using that code, what that code is doing is turning off the caching totally.

Michelle

michelle’s picture

I made a start on this. I changed things around so all the information is from the same topic. Still need to sort out the caching issue.

Michelle

derhasi’s picture

Status: Active » Needs review

Adding hook_comment and hook_nodeapi to the module will fix the caching-issues!

function advanced_forum_comment($a1, $op){
	switch ($op) {
		case 'insert':
		case 'update':
		case 'publish':
		case 'unpublish':
		case 'delete':
			advanced_forum_get_all_last_topics(TRUE);
			break;
	}	
}

function advanced_forum_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL){
	if ($node->type == 'forum'){
		switch ($op) {
			case 'delete':
			case 'delete revision':
			case 'insert':
			case 'update':
				advanced_forum_get_all_last_topics(TRUE);
				break;
		}
	}
}
michelle’s picture

Running the query on every comment delete and node update would cause more load than simply disabling the cache I think. :) There's got to be another way. I need to read up more on caching. First I need to get the thing working properly. For some reason it's displaying anonymous for every post.

Michelle

michelle’s picture

Title: Last post link on forum overview not caching properly » Fix last post link on forum overview
Status: Needs review » Active

Making the title more generic because it's not just caching at issue here.

Michelle

michelle’s picture

Status: Active » Fixed

Ok, I got this working. I still want to add the little jump to the last comment but the main issue here is fixed.

Michelle

phinest123’s picture

For me last post doesn't show anything at all. i took the latest release. should i take dev snapshot?

michelle’s picture

Status: Fixed » Postponed (maintainer needs more info)

The dev and alpha 4 are currently the same. This is working fine for me on 3 sites. Sounds like maybe you didn't copy the .tpl files?

Michelle

michelle’s picture

Status: Postponed (maintainer needs more info) » Fixed

Marking this fixed. The 5.x version seems to be working just fine. I know the 6.x version still has broken caching. :(

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

general need’s picture

Version: 5.x-1.x-dev » 5.x-1.0-alpha8

Hi Michelle, sorry to re-activate this, but I have the same problem as described by the OP:

Last Post's Title is first post's
Time posted and poster name is correct as the last post's.

using Advanced Forum 5.x-1.0-alpha8.

Should I upgrade to alpha9?

Also, is this correct? Perhaps this is the problem?

/**
* Override or insert PHPTemplate variables into the templates.
*/
function _phptemplate_variables($hook, $vars) {
if (module_exists('advanced_forum')) {
$vars = advanced_forum_addvars($hook, $vars);
}
if (module_exists('advanced_profile')) {
$vars = advanced_profile_addvars($hook, $vars);
}

return $vars;

if ($hook == 'page') {

if ($secondary = menu_secondary_local_tasks()) {
$output = '<span class="clear"></span>';
$output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
$vars['tabs2'] = $output;
}

// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
return $vars;
}
return $vars;
}
michelle’s picture

You need to remove the first return $vars; or the rest of the code in there won't work. As to the problem, I'm working on it.

Michelle

cschaafsma’s picture

If anyone is still having problems with Anonymous showing up in the topic list where there is a reply to a new topic this worked for me.
Change line 885 in advanced_forum.module

c.name AS topic_reply_name

to

c.name AS topic_author_name

Hope this helps folks. Michelle let me know if this is not correct. Seems to be working though.