Skip to content
Snippets Groups Projects
Commit 67a960c1 authored by Liam Morland's avatar Liam Morland Committed by Kevin Kaland
Browse files

Issue #1356304: Fix default submission detection.

parent a036f30c
No related branches found
No related tags found
No related merge requests found
...@@ -256,9 +256,9 @@ function fillpdf_merge_pdf($fid, $nids = NULL, $webform_arr = NULL, $sample = NU ...@@ -256,9 +256,9 @@ function fillpdf_merge_pdf($fid, $nids = NULL, $webform_arr = NULL, $sample = NU
} }
foreach ($webform_arr as $webform) { foreach ($webform_arr as $webform) {
if (!$webform['sid']) { // user didn't specify submission-id, meaning they want most recent if (empty($webform['sid'])) { // User did not specify submission ID, meaning they want most recent.
$webform['sid'] = db_query('SELECT sid FROM {webform_submissions} $webform['sid'] = db_query('SELECT sid FROM {webform_submissions}
WHERE nid=%d AND uid=%d ORDER BY submitted desc', $webform['nid'], $user->uid)->fetchField(); WHERE nid = :nid AND uid = :uid ORDER BY submitted DESC', array(':nid' => (int) $webform['nid'], ':uid' => (int) $user->uid))->fetchField();
} }
$webforms[] = array( $webforms[] = array(
'webform' => node_load($webform['nid']), 'webform' => node_load($webform['nid']),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment