I found that while sending feedback through to Unfuddle that the username is always 'Anonymous'.

template_preprocess_feedback_entry uses format_username($entry) but I can't see where we ever set $entry->name to make that work. Not sure why it works at all, but in some cases it obviously doesn't.

Comments

sun’s picture

Looks like we should have tests for this?

jody lynn’s picture

Project: Feedback » Unfuddle Feedback
Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work

Moving to unfuddle feedback queue. I think we can just run a feedback_load within unfuddle_feedback_post_ticket() to ensure we have a fully loaded entry object.

barancekk’s picture

StatusFileSize
new970 bytes

I checked the feedback module and other modules that depends on it. For now we can classify this issue of feedback module as its feature and add the 'name value' for the user in unfuddle_feedback module. I prepared the patch that solves this problem for now. Changed is unfuddle_feedback_post_ticket function in unfuddle_feedback module. Since this function already loads user data I just added the name to $entry object that is later passed to feedback module.

Patch is in attachment.

jody lynn’s picture

+++ b/unfuddle_feedback.moduleundefined
@@ -25,13 +25,16 @@ function unfuddle_feedback_feedback_insert($entry) {
   if (!$user->uid) {
     $name = t('Anonymous');

Use $entry->name here too?

+++ b/unfuddle_feedback.moduleundefined
@@ -25,13 +25,16 @@ function unfuddle_feedback_feedback_insert($entry) {
+    // Setting the name to entry object fix the issue with user name
+    // when creating feedback and tickets in unfuddle. http://drupal.org/node/1330756

Comment not needed.

$name variable not needed.

+++ b/unfuddle_feedback.moduleundefined
@@ -25,13 +25,16 @@ function unfuddle_feedback_feedback_insert($entry) {
 
   $subject = t('!name: !message', array('!name' => $name, '!message' => truncate_utf8($description, 20, TRUE)));
 

Just use $entry->name not $name here as well

barancekk’s picture

StatusFileSize
new1.04 KB

I made changes with name variable and code. New patch is included in attachment.

Thank you

jody lynn’s picture

Status: Needs work » Fixed

Committed. Thanks.

jody lynn’s picture

Committed. Thanks.

Status: Fixed » Closed (fixed)

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