Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This PDO error happens when I export a feature with strongarmed variables.
PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined: SELECT * FROM {variable} WHERE name IN ... (line 175 of /Applications/MAMP/htdocs/z3/www/profiles/zondervan/modules/contrib/strongarm/strongarm.module).
line 175:
$result = db_query("SELECT * FROM {variable} WHERE name IN (:names)", array(':names' => $data));
Comment | File | Size | Author |
---|---|---|---|
#1 | export-query-error-1309176-1.patch | 736 bytes | recrit |
Comments
Comment #1
recrit CreditAttribution: recrit commentedI changed
array(':names' => $data)
toarray(':names' => array_values($data))
and the error has gone away now. Attached patch applies this change.Comment #2
recidive CreditAttribution: recidive commentedPatch in #1 works for me.
Comment #3
recidive CreditAttribution: recidive commentedHello, we use this module in our distribution, and we need a proper release for it to be packed by drupal.org scripts.
Can we have this patch committed and a Unstable 3 version released?
Comment #4
lee20 CreditAttribution: lee20 commentedConfirming that the patch from #1 worked for me as well.
Comment #5
hgmartini CreditAttribution: hgmartini commentedAnother confirmation for patch in #1. I just tried it and it worked.
Comment #6
luisortizramos CreditAttribution: luisortizramos commentedThe patch in #1 works here also. Kudos!
Comment #7
ngmaloney CreditAttribution: ngmaloney commentedConfirming patch in #1 worked for me. This bug appears to affect exporting variables with names over a certain number of characters. A variable name with 29 characters does not trigger bug, a variable name with 48 characters will trigger it.
Replicated using:
- Drupal 7.9
- Features 7.x-1.0-beta4
- Strongarm 7.x-2.0-beta3
Comment #8
febbraro CreditAttribution: febbraro commentedCan someone tell me if the patch in #1350346: Fatal error when exporting variables with colons in their names solves the same issue?
Comment #9
febbraro CreditAttribution: febbraro commentedOn further review I dont actaully thing the patch here is correct, and I think the one I reference in #8 is actually the correct fix. Marking duplicate for now as I think it will fix the problem. Specifically I used the patch form #8 and tested with variables that were 50+ characters long including dashes and : and some other screwy chars.