When editing an existing comment and previewing it, the preview gets generated via the default drupal comment template, instead of the advf-forum-preview-post.tpl.php.

The error can be traced to the advanced_forum_treat_as_forum_post() function only checking for the special case 'comment/reply', but *not* for 'comment/edit'.

CommentFileSizeAuthor
#1 advanced_forum-482902-1.patch1.81 KBHenrik Opel

Comments

Henrik Opel’s picture

Status: Active » Needs review
StatusFileSize
new1.81 KB

The attached patch fixes the issue by adding the missing special case checks for 'comment/edit' pages and ensuring a proper $node variable initialization in advanced_forum_preprocess_comment() for those pages also.

michelle’s picture

Category: bug » task

Thanks, I'll try to take a look at this soon. I don't remember any specific reason for excluding editing so it's likely it just didn't occur to me to add it for that. Not so much a bug as simply not covering all possible cases. :) But I don't see any reason this can't be added to 1.x.

Michelle

Henrik Opel’s picture

Hi, thanks for the quick reaction - somehow I'm not used to that around here ;)

As for the question of bug vs. 'not covering all possible cases':
A preview that does not show the result as it will be shown afterward is at least useless, if not actively misleading. Therefore it should be considered broken, imho. (No reason to start one of those moot 'bug vs. task' discussions, of course - I can surely live with the classification as a task ;)

More important note: Thank you for this useful module :)

michelle’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Well, it's not a bug in that AF was designed to style the "view" mode, not the "create" mode. I believe styling during a reply was the result of a user request and just sort of tacked in there. So I don't really consider it broken for not doing something it was never intended to do in the first place.

At any rate, I am working on overhauling the whole process of what gets styled as a forum post and that will cover this case as well. I don't know if I will backport it to 1.x. It depends on how long 2.x takes to come out. In the mean time, folks have your patch if they need it.

Thanks,

Michelle

michelle’s picture

Status: Needs review » Closed (duplicate)