Hello! Hoping I am posting in correct place (if there is a better one please let me know). I am assisting with campaign website for our local library system and hoping to use simplenews as a means to get the word out. We decided to install Druapl 7 and I am attempting to use version 7.x.x-dev of Simplenews. I am getting the following errors when trying to subscribe to a newsletter. Can someone give me some guidance to resolve? Is this related to the development of the module, or is their some configuration I am missing? Thanks for any assistance you can provide.

To recreate, follow this link and try to subscribe.
http://www.keepourlibrariesopen.org/newsletter/subscriptions

Here are the error messages I receive when I try it....
•Notice: Undefined variable: subscription_checkboxes in simplenews_subscription_manager_form_submit() (line 81 of /home/content/g/o/l/golibrary/html/sites/all/modules/simplenews/includes/simplenews.subscription.inc).
•Warning: array_filter() [function.array-filter]: The first argument should be an array in simplenews_subscription_manager_form_submit() (line 81 of /home/content/g/o/l/golibrary/html/sites/all/modules/simplenews/includes/simplenews.subscription.inc).
•Warning: array_keys() [function.array-keys]: The first argument should be an array in simplenews_subscription_manager_form_submit() (line 81 of /home/content/g/o/l/golibrary/html/sites/all/modules/simplenews/includes/simplenews.subscription.inc).
•Warning: Invalid argument supplied for foreach() in simplenews_subscription_manager_form_submit() (line 81 of /home/content/g/o/l/golibrary/html/sites/all/modules/simplenews/includes/simplenews.subscription.inc).

Comments

simon georges’s picture

Title: Library needs assistance with simplenews » Undefined variable: subscription_checkboxes in simplenews_subscription_manager_form_submit() line 81
Status: Active » Fixed

Hi,

I've just committed a fix in git. The fixed 7.x-1.x-dev version should be available to download within 12 hours.
Meanwhile, you can manually move the line 81 of /home/content/g/o/l/golibrary/html/sites/all/modules/simplenews/includes/simplenews.subscription.inc to before the switch, to have something like :

$subscription_checkboxes = $form_state['categories'];
switch ($form_state['values']['op']) {
  case t('Update'):

instead of

switch ($form_state['values']['op']) {
  case t('Update'):
    $subscription_checkboxes = $form_state['categories'];//array_filter($form_state['values'],'is_int');

.

Please reopen if you still have the issue with the updated version.

Status: Fixed » Closed (fixed)

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