Fixed bug in Survey::ExpressionEngine - was not using most recent survey

response to resolve external values
This commit is contained in:
Patrick Donelan 2009-07-03 01:39:53 +00:00
parent 79692ca8fe
commit 29f20d3889

View file

@ -524,7 +524,7 @@ sub run {
# Get the responseId of the most recently completed survey response for the user
my $userId = $opts->{userId} || $session->user->userId;
my $mostRecentlyCompletedResponseId = $session->db->quickScalar(
"select Survey_responseId from Survey_response where userId = ? and assetId = ? and isComplete = 1",
"select Survey_responseId from Survey_response where userId = ? and assetId = ? and isComplete = 1 order by endDate desc limit 1",
[ $userId, $assetId ]
);