Symptoms
When saving or creating a newsletter issue, the newsletter (taxonomy term) is not saved with the issue (node). Thus, the newsletter issue does not belong to any newsletter.
Affects
Drupal 6.24 core codebases and greater.
Issue details
To fix a bug in the taxonomy system, Drupal core altered the way that taxonomy is presented in the node object during the "Update" and "Insert" operations in the nodeapi.
See #1427848: Node taxonomy array key change on node_save
The Fix
I'm attaching a patch for all 6.x-2.x branches of simplenews to account for any drupal core version when assigning the simplenews term id on the update and insert operations.
Comments
Comment #1
KeyboardCowboyThis patch affects simplenews.module on the 6.x-2.x branch only and fixes the issue surrounding the change to the taxonomy structure in Drupal 6.24.
Comment #2
berdirUsing $first_term = reset($node->taxonomy) and then checking that would probably be easier than this.
Comment #3
KeyboardCowboyPatch has been updated with the code recommended by @Berdir. I love picking up new tools. I can't believe I was never familiarized with those basic PHP array commands.
Comment #4
berdirLooks good.
I guess I'd also be fine with just supporting the newest core version, everyone should keep their core versions up to date anyway, but if we already have to code, then let's keep it.
Comment #5
husztisanyi commentedThis patch works for me, thanks!
Comment #6
simon georges commentedCommitted. Thanks!
Comment #7
berdirThis probably need to be ported to 6.x-1.x as well?
That branch is pretty much dead but this completely breaks the module and we have 17k reported users who are using 6.x-1.3...
Comment #8
simon georges commented@Berdir, do you mean we should release a 6.x-1.4 ?
Comment #9
berdirFirst, we actually need to commit yet, but yes, then it will require a release I guess.
Comment #10
berdirCan't reproduce this issue in 6.x-1.x. Back to fixed then.