In webform-hooks.php, the example hook _webform_analysis_component() should use db_placeholders() to find the number of argument for it's db query.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform-1054256.patch | 707 bytes | carinadigital |
In webform-hooks.php, the example hook _webform_analysis_component() should use db_placeholders() to find the number of argument for it's db query.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform-1054256.patch | 707 bytes | carinadigital |
Comments
Comment #1
carinadigital commentedI've attached a patch to use db_placeholders().
Comment #2
quicksketchThanks, updating the example to use best-practices is definitely good. Though if you use db_placeholders() that will just create placeholders like
IN (%d, %d, %d, %d). You'd need to pass in the $sids variable into the list of arguments in the query to fill in each placeholder.Comment #3
carinadigital commentedI think you already have this in db_query(), webform_hooks.php line 551
Here's the relevant code with the patch;
Comment #4
quicksketchHa! So I do. How strange. Thanks I'll put this in next time I'm doing patches.
Comment #5
quicksketchThanks committed. I updated the D7 doc for this same function while I was in there too.