User name is correct, but the link points to the profile of the last reply author.
I can't understand why needs this line in template_preprocess_forum_topic_list()
$topic->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;

Files: 
CommentFileSizeAuthor
#40 forum_1078646_0.patch721 bytesdroplet
PASSED: [[SimpleTest]]: [MySQL] 32,958 pass(es).
[ View ]
#28 forum-topic.jpg282.17 KBdroplet
#25 topic_user.jpg166.48 KBdroplet
#24 wrong-link-in-forum-author-1078646-24.patch979 byteslarowlan
PASSED: [[SimpleTest]]: [MySQL] 32,917 pass(es).
[ View ]
#22 forum_1078646.patch721 bytesdroplet
PASSED: [[SimpleTest]]: [MySQL] 32,931 pass(es).
[ View ]
#17 forum-createduser-1078646.patch863 bytesNneka
PASSED: [[SimpleTest]]: [MySQL] 35,792 pass(es).
[ View ]
#15 forum-createduser-1078646.patch1.11 KBNneka
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch forum-createduser-1078646_1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]
#12 forum-createduser-1078646.patch858 bytesVincent Giersch
PASSED: [[SimpleTest]]: [MySQL] 35,783 pass(es).
[ View ]
#10 forum-createduser-1078646.patch1.11 KBNneka
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch forum-createduser-1078646.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]
#1 forum_1078646.patch713 bytesdroplet
PASSED: [[SimpleTest]]: [MySQL] 31,541 pass(es).
[ View ]

Comments

Status:Active» Needs review
Issue tags:+Quick fix
StatusFileSize
new713 bytes
PASSED: [[SimpleTest]]: [MySQL] 31,541 pass(es).
[ View ]

introduce in this patch:
http://drupal.org/files/issues/taxonomy_67.patch

wrong patch I think, quick fix

Status:Needs review» Reviewed & tested by the community

I have applied the patch. It works fine.

The patch will be commited to HEAD?

Version:7.x-dev» 8.x-dev
Issue tags:+needs backport to D7

Status:Reviewed & tested by the community» Needs review

I'd like another pair of eyes on this patch because I don't think it is correct.

Removing that line is likely to break the 'last reply' field, not?

Shouldn't it be:

<?php
      $variables
['topics'][$id]->created = theme('forum_submitted', array('topic' => $topic));
     
$topic->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;
     
$variables['topics'][$id]->last_reply = theme('forum_submitted', array('topic' => isset($topic->last_reply) ? $topic->last_reply : NULL));
?>

Priority:Major» Normal
Status:Needs review» Needs work

Yes. Also not major.

Assigned:Unassigned» Nneka

Assigned:Nneka» Unassigned
Status:Needs work» Closed (fixed)

opening ticket. mistake to close. implementing the fix noted here.

Assigned:Unassigned» Nneka
Status:Closed (fixed)» Needs work

Version:8.x-dev» 7.x-dev
Status:Needs work» Needs review
StatusFileSize
new1.11 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch forum-createduser-1078646.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Preface this by saying a newbie to contributing and git.

Made the code change suggested in post #5, tested and everything seems to be working without fail. This attached patch was made for 7.x.

Status:Needs review» Needs work

The last submitted patch, forum-createduser-1078646.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new858 bytes
PASSED: [[SimpleTest]]: [MySQL] 35,783 pass(es).
[ View ]

Your patch was in a patch and there was an incorrect indentation.

what's the diff by move that line ?

Version:7.x-dev» 8.x-dev
Assigned:Nneka» Unassigned

#5, #12 moving that lines would result a wrong topic->uid.
topic->uid should be same as TOPIC author, not the comment user.

#1 my patch seems more right.

@Dires,
last reply handled in other parts:

$variables['topics'][$id]->last_reply = theme('forum_submitted', array('topic' => isset($topic->last_reply) ? $topic->last_reply : NULL));

Version:8.x-dev» 7.x-dev
StatusFileSize
new1.11 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch forum-createduser-1078646_1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

After looking a little deeper into the code, I would agree with #14.

I believe the only reason that line of code was added ($topic->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;), was to override the Commented by (its being used when called the form_submitted theme to display the user submission info.).

I've tested with this line of code commented out and it works fine.

Including the fix for Drupal 7 with the code above removed.

Status:Needs review» Needs work

The last submitted patch, forum-createduser-1078646.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new863 bytes
PASSED: [[SimpleTest]]: [MySQL] 35,792 pass(es).
[ View ]

Ignore the last patch. This one is correct.

Version:7.x-dev» 8.x-dev

@Nneka,
Please leave this at 8.x as we fix bugs first in 8.x and backport them as fast as possible.

Git patch:
http://drupal.org/node/707484

Sounds like you are going to do something like #1 patch ?

Yes. This patch is the same #1.

Version:8.x-dev» 7.x-dev

This ticket also exists as a duplicate. Closed http://drupal.org/node/1181240 as duplicate.

Hey,

Please don't change version again. Thanks!

Version:7.x-dev» 8.x-dev
StatusFileSize
new721 bytes
PASSED: [[SimpleTest]]: [MySQL] 32,931 pass(es).
[ View ]

still same as #1 but a -p1 style patch

both D7 & D8

Status:Needs review» Needs work

+++ b/modules/forum/forum.module
@@ -1123,7 +1123,6 @@ function template_preprocess_forum_topic_list(&$variables) {
-      $topic->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;

This line is needed when constructing the last reply theme output.
The problem is it needs to be set after the created variable is set.
Ie it doesn't need to be removed, it just needs to go after

$variables['topics'][$id]->created = theme('forum_submitted', array('topic' => $topic));

and before
$variables['topics'][$id]->last_reply = theme('forum_submitted', array('topic' => isset($topic->last_reply) ? $topic->last_reply : NULL));

see http://api.drupal.org/api/drupal/modules--forum--forum-submitted.tpl.php... and http://api.drupal.org/api/drupal/modules--forum--forum.module/function/t... in the last reply variable ($variables['topics'][$id]->last_reply)) we need the 'by' link to point to the last_comment_uid.

Powered by Dreditor.

Status:Needs work» Needs review
StatusFileSize
new979 bytes
PASSED: [[SimpleTest]]: [MySQL] 32,917 pass(es).
[ View ]

Reroll with my comments

StatusFileSize
new166.48 KB

@larowlan,

It passed

<?php
$topic
->last_reply
?>
into theme function

and theme function access

<?php
$variables
['topic']->uid
?>

the result it will access:

<?php
$topic
->last_reply->uid
?>

see my attached image & try to test my patch #22 :)

EDIT:
my debug function is after this line

<?php
$topic
->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;
dsm($topic);
?>

topic created with UID 1, so the attached image UID change to 2 which is wrong.

Please see http://api.drupal.org/api/drupal/modules--forum--forum-topic-list.tpl.ph...
We need to set the $topic->uid to that of the last commenter to make the 'last reply' column work.

So there are two calls to theme('forum_submitted'
The first one to setup the 'created by' column, the second to setup the 'last reply' column.
Without your patch, the 'created by' column does not work.
With your patch, the 'last reply' column does not work.
I think my patch is the common ground where they both work.

Please advise.

can you capture a screenshot to show how it doesn't work & point out the line that used $topic->uid on
http://api.drupal.org/api/drupal/modules--forum--forum-topic-list.tpl.ph...

what's your drupal version ?

StatusFileSize
new282.17 KB

my turn. I don't see any problem

$variables['author'] in forum_submitted.tpl.php is set here using $topic->uid:
http://api.drupal.org/api/drupal/modules--forum--forum.module/function/t... and then output here
http://api.drupal.org/api/drupal/modules--forum--forum-submitted.tpl.php...

@larowlan,

are you tested with fresh installation ?? and on same issue ? I know you are the new forum maintainer, maybe working on a lot of forum issues and make comment on wrong issue ??

What here is fixing template_preprocess_forum_topic_list on forum topic list

but you are taking about forum_submitted on forum thread (node) page.

Anything I missed ??

@droplet
template_preprocess_forum_topic_list calls theme('forum_submitted' which in turn calls template_preprocess_forum_topic_list which in turn uses $topic->uid to set the author.
template_preprocess_forum_topic_lic calls theme('forum_submitted' twice, once for the creator and again for the last reply - in the first instance the author is the original $topic->uid, in the second instance it's the commenter hence before the second call needs $topic->uid set to that of the commenter.

@larowlan,

Listen, give me a chance :)
- First reinstall your Drupal-8-dev
- add new user
- create a forum topic & reply is with different user

then edit this function and add debug function

<?php
function template_preprocess_forum_submitted(&$variables) {
 
dsm($variables['topic']);
 
$variables['author'] = isset($variables['topic']->uid) ? theme('username', array('account' => $variables['topic'])) : '';
 
$variables['time'] = isset($variables['topic']->created) ? format_interval(REQUEST_TIME - $variables['topic']->created) : '';
}
?>

Compare what's the difference.

Why your patch (seems like) solve the problem?

Because whatever you changed, it never pass into theme function (last_reply). It's like my patch (removed that line)

<?php
$variables
['topics'][$id]->last_reply = theme('forum_submitted', array('topic' => isset($topic->last_reply) ? $topic->last_reply : NULL));
?>

Notice: Patch #24 will get it work but if you try to theme your fourm list on forum-topic-list.tpl, you never know who is the topic creator.

try add following on forum-topic-list.tpl after you patched with #24

<?php
dsm
($topics);
?>

You will see UID is always equal to last reply user. (this UID should be the topic creator)

Hope you understand it, I have no idea to explain more in details.

Hope i'm not wrong so. :)

any other guys have chance to review it ??

You're right, there is no difference between your patch and mind, the second call to theme('forum_submitted' passes $topic->last_reply (not $topic as I thought).

So yours is the better patch.

#22: forum_1078646.patch queued for re-testing.

Status:Needs review» Reviewed & tested by the community

The patch in #22 is good to go, I had changed it at #24 based on Dries comments at #5 but as rightly pointed out by @droplet, there is no difference between the two. The last reply columns works without the offending line.

Sorry for my ignorance and if I've misunderstood... so this patch has been applied to drupal 8... but isn't backported to drupal 7 yet? What's the timeline for this happening?

Hi Luke,
No the patch in #22 has not been applied anywhere yet.
You can apply it to Drupal 7.8 if you wish.
The patch should apply cleanly against both Drupal 7 and 8.
The patch should hopefully be committed before the next Drupal 7 point release (Drupal 7.9) which is due to come out at the end of the month.

Thanks for the clarification Larowlan :)
I'll delete the line from my 7.8, and look forward to seeing the implementation in 7.9

Status:Reviewed & tested by the community» Needs work

+++ b/modules/forum/forum.module
@@ -1127,8 +1127,10 @@ function template_preprocess_forum_topic_list(&$variables) {
-      $topic->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;
       $variables['topics'][$id]->created = theme('forum_submitted', array('topic' => $topic));
+      // Now we set the uid to correspond to the last comment so that username
+      // is used in the themed output.
+      $topic->uid = $topic->last_comment_uid ? $topic->last_comment_uid : $topic->uid;

For the world after us dinosaurs, can we clarify this comment on what "now" refers to and actually means?

Overall, I've the impression that we're relying on quite some bit of magic in that (overridable) theme function. If it gets overridden, the magic might be lost. Or not. Anyway, in the end, it looks like lots of non-obvious assumptions are being made here (unless I'm missing something obvious).

14 days to next Drupal core point release.

Status:Needs work» Reviewed & tested by the community
StatusFileSize
new721 bytes
PASSED: [[SimpleTest]]: [MySQL] 32,958 pass(es).
[ View ]

@sun, you're reviewed a wrong patch.

#22 is the right one.

(im just reupload it once.)

Yeah, the patch at #40 is the right one (same as #22).

Status:Reviewed & tested by the community» Fixed

Committed to 7.x and 8.x. Thanks.

Status:Fixed» Closed (fixed)
Issue tags:-Quick fix, -needs backport to D7

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