Hello,

if I click on the column header for the username column in the table view of the results, I get the following error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'order clause': SELECT ws.sid AS sid FROM {webform_submissions} ws WHERE (nid = :db_condition_placeholder_0) ORDER BY name ASC LIMIT 50 OFFSET 0; Array ( [:db_condition_placeholder_0] => 36 ) in PagerDefault->execute() (Zeile 79 von /is/htdocs/*****/www/includes/pager.inc).

All other colums are working, but the username column doesn't.
Is this a known bug? do you have any recommendations?

Thanks,
Basti

Files: 
CommentFileSizeAuthor
#4 webform_sort_username.patch571 bytesquicksketch

Comments

Thanks for the report. I think this is the first report of this bug, but it's something we've encountered in the past. I'll look into it.

The related issue that I was thinking of was #1074326: PDOException: SQLSTATE[23000] -- when viewing submissions . So this is definitely a separate problem that hasn't been addressed before.

Priority:Normal» Minor
Status:Active» Fixed
StatusFileSize
new571 bytes

I've committed this patch to correct the issue. This patch may unnecessarily join the user table even if the "name" or "uid" column is not necessary, but at the same time we only pass in the $header variable on this page alone, so it's not going to affect any other places in the core module. Other places where you'd likely pass in a $header would also want the user table anyway, so I don't think this is an unfair compromise. In any case, fixes the immediate problem.

Title:result: ordering by user does not workResult tab: ordering by user name throws PDO error

I can confirm that this patch works fine against 7.x-3.17.

Thanks very much.

Status:Fixed» Closed (fixed)

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