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));
CommentFileSizeAuthor
#1 export-query-error-1309176-1.patch736 bytesrecrit
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

recrit’s picture

Status: Active » Needs review
FileSize
736 bytes

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

recidive’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #1 works for me.

recidive’s picture

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?

lee20’s picture

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

hgmartini’s picture

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

luisortizramos’s picture

The patch in #1 works here also. Kudos!

ngmaloney’s picture

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

febbraro’s picture

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

febbraro’s picture

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.