In oa_user_access_nids, there's a SQL query that's causing a fatal SQL error:

PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: SELECT nid FROM {node} WHERE nid in :nids_0, nids_1, nids_2, nids_3, nids_4, nids_5, nids_6, nids_7, nids_8, nids_9, nids_10, nids_11, nids_12, nids_13, nids_14, nids_15, nids_16, nids_17, nids_18, nids_19, nids_20, nids_21, nids_22, nids_23, nids_24, nids_25, nids_26, nids_27, nids_28, nids_29, nids_30, nids_31, nids_32, nids_33, nids_34, nids_35, nids_36, nids_37, nids_38, nids_39, nids_40, nids_41, nids_42, nids_43, nids_44, nids_45, nids_46, nids_47, nids_48, nids_49, nids_50, nids_51, nids_52, nids_53, nids_54, nids_55 AND uid = :uid; Array ( [:uid] => 441 [nids_0] => 4523 [nids_1] => 5221 [nids_2] => 5394 [nids_3] => 5615 [nids_4] => 12054 [nids_5] => 12056 [nids_6] => 47412 [nids_7] => 47727 [nids_8] => 48479 [nids_9] => 48584 [nids_10] => 48588 [nids_11] => 48589 [nids_12] => 48590 [nids_13] => 48591 [nids_14] => 48592 [nids_15] => 48593 [nids_16] => 48594 [nids_17] => 48616 [nids_18] => 48617 [nids_19] => 48619 [nids_20] => 48620 [nids_21] => 48621 [nids_22] => 55415 [nids_23] => 56224 [nids_24] => 57612 [nids_25] => 57613 [nids_26] => 57615 [nids_27] => 57751 [nids_28] => 59796 [nids_29] => 60507 [nids_30] => 62418 [nids_31] => 62939 [nids_32] => 63064 [nids_33] => 63563 [nids_34] => 63707 [nids_35] => 63772 [nids_36] => 71072 [nids_37] => 74103 [nids_38] => 75166 [nids_39] => 77663 [nids_40] => 79638 [nids_41] => 79668 [nids_42] => 80072 [nids_43] => 80398 [nids_44] => 80809 [nids_45] => 84419 [nids_46] => 86004 [nids_47] => 87028 [nids_48] => 91967 [nids_49] => 96553 [nids_50] => 98598 [nids_51] => 98601 [nids_52] => 100935 [nids_53] => 101238 [nids_54] => 102050 [nids_55] => 102282 ) in oa_user_access_nids() (line 1550 of code/profiles/openatrium/modules/contrib/oa_core/includes/oa_core.util.inc).

Have you run into this before? Is this a full replacement to organic groups user access model?

Comments

RobLoach created an issue. See original summary.

robloach’s picture

Issue summary: View changes
robloach’s picture

Status: Active » Fixed

Fixed with:

variable_set('og_group_manager_full_access', FALSE);

Skips running the SQL.

mpotter’s picture

Status: Fixed » Active

Never seen that before. And the SQL statement that you showed looks perfectly fine to me, so not sure what the cause it.

Setting that variable is just sidestepping the problem rather than figuring out the root cause.

Maybe that db_query needs to be refactored into a better db_select function, so patches for that are welcome. But I'm leaving this Active because I don't think the "solution" in #3 is really a correct solution.

alan-ps’s picture

Version: 7.x-2.52 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new869 bytes

There are two mistakes in this SQL statement:

1. Missed brackets :nids should be (:nids); see https://www.drupal.org/node/310072
2. Missed a colon before the nids placeholder (should be :nids).

Patch attached.

mpotter’s picture

Well that definitely seems like a no-brainer then. I totally missed it not having (). I think Drupal handles the case of the missing colon, but will add that also for correctness. Thanks for the patch!

mpotter’s picture

Status: Needs review » Fixed

Committed to 99a75de.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.