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:

<?php
$result
= db_query("SELECT * FROM {variable} WHERE name IN (:names)", array(':names' => $data));
?>
Files: 
CommentFileSizeAuthor
#1 export-query-error-1309176-1.patch736 bytesrecrit

Comments

Status:Active» Needs review
StatusFileSize
new736 bytes

I changed array(':names' => $data) to array(':names' => array_values($data)) and the error has gone away now. Attached patch applies this change.

Status:Needs review» Reviewed & tested by the community

Patch in #1 works for me.

Hello, 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?

Confirming that the patch from #1 worked for me as well.

Another confirmation for patch in #1. I just tried it and it worked.

The patch in #1 works here also. Kudos!

Confirming 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

Can someone tell me if the patch in #1350346: Fatal error when exporting variables with colons in their names solves the same issue?

Status:Reviewed & tested by the community» Closed (duplicate)

On 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.