When creating the category after just having added a Newsletter field. The error clears after refreshing the page and editing the field so it has a taxonomy vocabulary list provided:
Notice: Undefined index: vocabulary in taxonomy_allowed_values() (line 1358 of /modules/taxonomy/taxonomy.module).
Notice: Undefined index: vocabulary in taxonomy_field_settings_form() (line 1516 of /modules/taxonomy/taxonomy.module).
Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /includes/common.inc on line 2134 and defined in drupal_http_build_query() (line 469 of /includes/common.inc).

When sending a newsletter:
(on a blank page..)
Fatal error: Cannot use object of type stdClass as array in /modules/simplenews/simplenews.module on line 456
*and the letter did not go through

Comments

jessesteele’s picture

I just tried the new version, Nov 4, still the same error when attempting to send to a list of emails, not users.

simon georges’s picture

Closing #962124: Edit Newsleter Taxonomy Error as a duplicate of this one.

simon georges’s picture

The second error should be fixed by #894554: What is line 456 in simplenews.module doing?.
I'm looking into the first one.

simon georges’s picture

Status: Active » Needs review
StatusFileSize
new937 bytes

Ok, I think I have figured it out, it comes from the field definition. You'll find a patch attached.
To have the patch working, you'll have to completely remove Simplenews (uninstall the module, and manually remove the content type), so when you install Simplenews after patching it, the new field definition will be ok.

If you want to manually fix your installation without the patch, it's actually quite simple, go to "Content types / Simplenews Newsletter / Manage fields / Newsletter category", and manually select a vocabulary, everything should be fine after it.

simon georges’s picture

Actually, there still is a bug, but I don't know if it's Simplenews or core related : when saving the node, an error message states that "a newsletter term is required", the fact is that the term is associated with the language "und" (as "undefined", exactly like path or body language), but the node language is "en" (or at least the default one of your plateform), so the following test :

  if (isset($node->{$category_field['field_name']}[$node->language])) {
    return $node->{$category_field['field_name']}[$node->language];
  }

fails (in simplenews_get_term_values() function).

The patch above still fixes a few D7 Simplenews bugs, but it allows us to discover new issues ;)

miro_dietiker’s picture

Status: Needs review » Needs work

Fixes committed to dev...
So does this issue still needs work or is it fixed?

simon georges’s picture

This issue itself is fixed, I just discovered another one ;) Maybe I'll be better off creating another one ?

miro_dietiker’s picture

Status: Needs work » Fixed

jop

Well simon, feel free to provide a monsterpatch for d7 to make it work ;-) ... i'm not too much for named issue-per-issue fixing in the d7 yet -- it simply is too broken atm.

Currently i'm (almost) blind committing things in D7 ... periodically looking if it still works (or somehow works a little better ;-) )

Status: Fixed » Closed (fixed)

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