warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/html/test5.2/sites/all/modules/subscriptions_og/subscriptions_og.module on line 902.

subscriptions_og_page_group_type() calls drupal_get_form() with 4 parameters, but drupal_get_form() only accepts 1. As a result subscriptions_og_group_type_form($group_types, $account, $form) does not receive the extra parameters. This causes the above error since $account is not passed along. Please note that there are other non-exposed errors too as the logic will be flawed due to omitted parameter values.

See: http://api.drupal.org/api/function/drupal_get_form/5

Comments

jgraham’s picture

Status: Active » Closed (fixed)

Invalid, sorry I misread the documentation.

I think there is an error lurking still, but this is not the cause. I'll open a new ticket if the cause is determined.

jgraham’s picture

Title: improper use of drupal_get_form() » parameters not populated on call to subscriptions_og_group_type_form() via subscriptions settings.
Status: Closed (fixed) » Active

I found the cause of the above error.

When at admin/settings/subscriptions/userdefaults/group

I receive;

warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/html/test5.2/sites/all/modules/subscriptions_og/subscriptions_og.module on line 902.

subscriptions_og_page_group_type() calls subscriptions_og_group_type_form($group_types, $account, $form) but $account, or the other parameters are not populated with any data.

develcuy’s picture

Thank you @Jgraham, this error happening because I've added handling of groups a user is member.
For userdefaults, $account is NULL because must be handled as anonymous, so now I fixed code to populate $account->uid = 0 but right after validation of $uid which is used to load correct data for subscriptions controls.

Please confirm this error is fixed in CVS.

Blessings!

jgraham’s picture

Status: Active » Fixed

Confirmed fixed in CVS.

Defaults are also properly inherited on new user accounts. Great job develCuy! :-D

Setting to fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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