Hi.

I have already installed Simplenews 1.3 and this works fine for me. After the upgrade to version 1.4, the email-form in the simplenews subscription-block is not visible.

Drupal returns following Error-Message with every page-view:

call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'simplenews_block_form_7' was given in /drupal/includes/form.inc in Zeile 218.

Many Thanks for Help.
Frank

Comments

sutharsan’s picture

Do your newsletters still have the usual 'Newsletter sending options'? Then goto the block admin page (/admin/build/block) and re-install the block.
If your newsletters do show the 'Newsletter sending options' than you need to disable and enable the module. This will reset the simplenews taxonomy. You will need to re-create your newsletter issue tags.
Edit: If your newsletters do show the 'Newsletter sending options', please report or contact me on IRC.
Edit: If your newsletters do NOT show the 'Newsletter sending options', please report or contact me on IRC.

jadymitchell’s picture

Status: Active » Postponed (maintainer needs more info)

I have the same problem.

sutharsan’s picture

I have the same solution.

frank.dev’s picture

Hi Sutharsan,

Excuse for the fact that now only I announce myself.

If your newsletters do show the 'Newsletter sending options', please report or contact me on IRC.

Yes, the 'Newsletter sending options' is visible.

Thanks and greetings
Frank

sutharsan’s picture

Have you tried the first part of my #1 comment? Remove the bock and re-enable it?
I've now corrected a typo in the second part of #1.

sgabe’s picture

I have the same problem. The subscription block displays only the block message, the subscription form is missing. I tried remove, and re-enable the block, but it doesn't work.

frank.dev’s picture

Have you tried the first part of my #1 comment? Remove the bock and re-enable it?

Sorry, I forgot to mention it: yes, I remove and re-enable the Newsletter-Block on /admin/build/block .

sutharsan’s picture

I need some more information:
1. Any errors in the watchdog like "First argument is expected to be a valid callback, 'simplenews_block_form_7'"?
2. Do you have one or multiple vocabularies 'Newsletter' on the Category admin page (admin/content/taxonomy)?
3. Does the newsletter list on the simplenews admin pages (admin/content/newsletters/types) show your regular newsletters or none?
4. Edit the simplenews.module and replace the simplenews_forms() function (line 768 in 5.x-1.x-dev) with the folowing code:

function simplenews_forms() {
  $forms = array();
  if ($tree = taxonomy_get_tree(variable_get('simplenews_vid', ''))) {
    foreach ($tree as $newsletter) {
      $forms['simplenews_block_form_'. $newsletter->tid] = array(
        'callback' => 'simplenews_block_form',
        'callback arguments' => array($newsletter->tid),
      );
      // Begin debug code -------
      drupal_set_message('newsletter: '. check_plain($newsletter->name));
      // End debug code -------
    }
  }
  // Begin debug code -------
  else {
    if (variable_get('simplenews_vid', '')) {
      $vocabulary = taxonomy_get_vocabulary(variable_get('simplenews_vid', ''));
      $name = $vocabulary->vid ? check_plain($vocabulary->name) : 'vocabulary does not exist';
      drupal_set_message($name . ' ('. variable_get('simplenews_vid', '') .')');
    }
    else {
      drupal_set_message('simplews_vid is empty');
    }
  }
  // End debug code -------
  return $forms;
}

On every page where the block is displayed this code will show:
newletter: newsletter name
or
simplews_vid is empty
or
vocabulary name (vid number)
or
(vid number)

sgabe’s picture

1. Any errors in the watchdog like "First argument is expected to be a valid callback, 'simplenews_block_form_7'"?

No, I see just this one.

2. Do you have one or multiple vocabularies 'Newsletter' on the Category admin page (admin/content/taxonomy)?

I have one 'Newsletter' vocabulary on the Category admin page.

3. Does the newsletter list on the simplenews admin pages (admin/content/newsletters/types) show your regular newsletters or none?

The newsletter list shows my regular newsletter.

4. Edit the simplenews.module and replace the simplenews_forms() function (line 768 in 5.x-1.x-dev) with the folowing code:...

I replaced the code. With user number 1 I see the 'newletter: newsletter name' message on the top of the page, with a simply user I see the 'vocabulary name (vid number)' message.

In these points everything seems just fine, I think. But with user number 1, there is no error message, only if I log in with a simply user. I got this error message, and the subscription form in the block doesnt show, just the newsletter message. With user number 1 everything works just fine.

sutharsan’s picture

@sgabe: you have a different problem than Frank.dev. I suspect you have some kind of access restriction in place for the 'simply user'. This user probably has no access to the newsletter vocabulary, which is required.

@Frank.dev: Please try #8. I plan to create a new issue shortly and want to include fixes for his.

sgabe’s picture

You are right, I checked the anonymous and authenticated users permissions in the Taxonomy-Access module. In the 'Newsletter' category I set the View, and Update permissions to enabled for these users. It works fine now, thanks for your help.

I think Frank.dev have the same problem, it is worth a shoot. I only noticed it too when I upgraded the simplenews module from 1.3 to 1.4 there was no problem before that.

sutharsan’s picture

@sgabe: View permission is enough. I will put a watchdog error message in to notify the admin of this configuration problem and possibly ad a line in the readme.

frank.dev’s picture

Hi Sutharsan!

Many Thanks for your support!

Here now my answers to your questions:

1. Any errors in the watchdog like "First argument is expected to be a valid callback, 'simplenews_block_form_7'"?

It is always the same mistake him is announced and which I already described in my first post.

2. Do you have one or multiple vocabularies 'Newsletter' on the Category admin page (admin/content/taxonomy)?

Yes, I have one vocabularies 'Newsletter'.

3. Does the newsletter list on the simplenews admin pages (admin/content/newsletters/types) show your regular newsletters or none?

'Newsletter' is indicated in the list.

4. Edit the simplenews.module and replace the simplenews_forms() function (line 768 in 5.x-1.x-dev) with the folowing code:

...

On every page where the block is displayed this code will show:
newletter: newsletter name
or
simplews_vid is empty
or
vocabulary name (vid number)
or
(vid number)

The following line is indicated (as anonymous user):

Newsletter (4)

Greetings
Frank

frank.dev’s picture

To information:

I also use the module "Taxonomy Access". But the authorisations settings are correctly put for the "anonymous user". In Simplenews 1.3 with the same settings has correctly worked.

sutharsan’s picture

The difference between 1.3 and 1.4 is the way the newsletter block form gets its data. A change was made to enable multiple newsletter blocks on one page (see http://drupal.org/node/273218). As a side effect is, as I now see, that anyone access the page with the block need access to the newsletter vocabulary and its terms.

Your results tell me that vocabulary and taxonomies are correctly set and are known by simplenews.
Please check the taxonomy access permissions again. Not having access is the only explanation.

Does giving access have any unwanted effects?

frank.dev’s picture

Status: Postponed (maintainer needs more info) » Fixed

Hi,

I have checked the settings of the "Taxonomy Access" again. After I activated the option "List" for the category "Newsletter", the subscription form was indicated for the Newsletter block again.

Many Thanks for your Support
Frank

sutharsan’s picture

Status: Fixed » Postponed (maintainer needs more info)

@all: are there use cases where it is required to restrict access to view the newsletter taxonomy but still have the ability to subscribe to newsletters?
It is possible to realize this possibility but I have to divert from the normal 'route'. If the use cases are strong enough you can convince me.

sutharsan’s picture

Status: Postponed (maintainer needs more info) » Fixed

No response, closing the issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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