Closed (won't fix)
Project:
Webform
Version:
7.x-3.19
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2013 at 15:36 UTC
Updated:
13 Nov 2014 at 21:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
funex commentedMy solution is to to pass the username for each submission through format_username() in webform_get_submissions().
The only drawback is this function requires a loading the user object for each iteration of through submissions - I wonder how expensive this is.
Please see patch attached.
Thanks,
Andy
Comment #2
funex commentedI'm not doing very well at this - I uploaded it relative to the wrong path! oops.
Comment #3
funex commentedOK lets try this one! :-)
Comment #4
quicksketchThanks for the patch @andyhails. I think it would be great to consistently format the user name, but this patch puts the formatting in the wrong location (on load instead of on view) and like you say, probably adds a lot of overhead. I'd prefer to see us using format_username() right before the information is displayed, rather than on load. There are many situations (CSV downloads, e-mails) where the user name may not be used at all, or it's not appropriate to run it through format_username (which will make an HTML link in many situations). We should format the username only where it's needed, rather than modifying the loading of submissions.
Additionally, I'd prefer to avoid loading the user account. I think format_username() actually is used in places where a full user object isn't available already (like in comments). If it's possible to just pass in the submission object into format_username(), that might be preferable for performance, though slightly inconvenient for users who are overriding theme_username(). I think we should cater to the majority of users who aren't going to be making that customization and go for the higher-performance/less-convenient approach.
Comment #5
quicksketchComment #6
danchadwick commentedVersion 7.x-3.x will get critical bug fixes only. Views will be used in the future from the tables above, and the CSV output should probably not be formatted.
Comment #7
danchadwick commentedVersion 7.x-4.2 will use views for the RESULTS/SUBMISSIONS and RESULTS/TABLE tabs. If you have access to a user name that gets formatted with format_username(), then this might help.