Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a potentially ambiguous column in SQL order by clauses. #2343

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/WeBWorK/ContentGenerator/Instructor/UserDetail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ WeBWorK::ContentGenerator::Instructor::UserDetail - Detailed User specific infor

use WeBWorK::Utils qw(x);
use WeBWorK::Utils::Instructor qw(assignSetToUser);
use WeBWorK::DB::Utils qw(grok_versionID_from_vsetID_sql);
use WeBWorK::Debug;

# We use the x function to mark strings for localizaton
Expand Down Expand Up @@ -158,7 +159,7 @@ sub initialize ($c) {
$c->{mergedVersions}{$setID} = [
$db->getMergedSetVersionsWhere(
{ user_id => $editForUserID, set_id => { like => "$setID,v\%" } },
\q{(SUBSTRING(set_id,INSTR(set_id,',v')+2)+0)}
\grok_versionID_from_vsetID_sql($db->{set_version_merged}->sql->_quote('set_id'))
)
];
}
Expand Down
8 changes: 5 additions & 3 deletions lib/WeBWorK/ContentGenerator/ProblemSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ problem set.
use WeBWorK::Debug;
use WeBWorK::Utils qw(path_is_subdir is_restricted wwRound before between after grade_set format_set_name_display);
use WeBWorK::Utils::Rendering qw(renderPG);
use WeBWorK::DB::Utils qw(grok_versionID_from_vsetID_sql);
use WeBWorK::Localize;

async sub initialize ($c) {
Expand Down Expand Up @@ -195,9 +196,10 @@ sub gateway_body ($c) {
my $timeInterval = $set->time_interval || 0;
my @versionData;

my @setVersions =
$db->getMergedSetVersionsWhere({ user_id => $effectiveUser, set_id => { like => $set->set_id . ',v%' } },
\q{(SUBSTRING(set_id,INSTR(set_id,',v')+2)+0)});
my @setVersions = $db->getMergedSetVersionsWhere(
{ user_id => $effectiveUser, set_id => { like => $set->set_id . ',v%' } },
\grok_versionID_from_vsetID_sql($db->{set_version_merged}->sql->_quote('set_id'))
);

for my $verSet (@setVersions) {
# Count number of versions in current timeInterval
Expand Down