I'm running drupal 5.0 and the latest version of simplenews. I have the category module installed. I created a new newsletter, and got the message that a new term had been created.

When I tried to create an issue of the newsletter, it didn't appear on the drop-down list. I went back to the simplenews page, and it isn't listed there, either.

Thanks,

Ken

Comments

yopyop’s picture

This was also the case for me in drupal 5.1. The newsletters I tried to create in the simplenews admin would not show up in the drowdown either.

I also was not able to see a simplenews block in administer > site building > blocks

fossilfool’s picture

Project: Simplenews » Category

This might be a bug with Taxonomy wrapper of the Category Module. This bug is similar to the problem people were having with new Forums not showing up. Jaza fixed that one recently. Could be similar to this. I move this issue to Category. A good test would be to install Simplenews on a clean Drupal 5.1 install with no Category module.

sutharsan’s picture

Assigned: Unassigned » sutharsan
Status: Active » Postponed (maintainer needs more info)

It looks like mrgroove's problem was solved by enabling the taxonomy wrapper.

Solidbluechameleon, please give more details of the problem since I can not create a situation for which your code is a solution. Please describe the setup of your category module and how you use the simplenews module with the category module.

sutharsan’s picture

Oops, working on other (but related?) issue. Pls ignore this posting.

sutharsan’s picture

Status: Postponed (maintainer needs more info) » Active
bdragon’s picture

Assigned: sutharsan » bdragon

Assigning to self, looking into this for fossilfool.

bdragon’s picture

Status: Active » Needs review
StatusFileSize
new938 bytes

Found it!

Simplenews checks $node->taxonomy during the submit hook. At that time, the wrapper has not injected $node->taxonomy yet.

Does this patch improve things for you guys?

bdragon’s picture

Hmm, this might also fix some of the Forum problems people are having. Investigating further...

bdragon’s picture

StatusFileSize
new1.06 KB

After more research, I came up with this. This one syncs during the validate op instead, and fixes some forum problems as well as the simplenews problem.

yopyop’s picture

Thanks, everyone who is working on this. I will apply the patch tonight soon and see what happens. In the meantime I rolled my own newsletter system by to an outside service, but I'd love to have this work..
best
barry

yopyop’s picture

Thanks bdragon, for the patch - I ran it, but I am still getting the same thing - the newsletter I create does not take - it doesn't show up in the list, but I notice if I go to adminster> content management > content, the node for the newsletter shows up, but it has no type set - so the simplenews module doesn't seem to be able to see it.. hmmm.

BTW I am using Drupal 5.1 and the newest Simplenews 5.1 dev version..

yopyop’s picture

It was suggested to me in a area drupal group to disable category module, and this cleared my issue up with simplenews.

sjh-1’s picture

I've found that this patch as committed into 1.26.2.1 corrupts the node_term table and hence breaks support for views and other modules. See #18 through #20 in http://drupal.org/node/87669 where I have a patch that should fix it.

megg’s picture

nevermind.

lias’s picture

Is this issue fixed now? Category module is still listed as incompatible with Simple news.

mcri’s picture

Wondering the exact same thing as pp...looking for a simple newsletter system to set up within my Drupal site, and Simplenews seems the most recommended/supported of contrib modules.
But Category is far too important for me to flub up w/an incompatible contrib module. Thanks for any updates!

lias’s picture

Checking status if simplenews is now compatible with category module.

Wolfflow’s picture

Subscribe.

marcoBauli’s picture

patch #7 above did the job! I can see all the newsletters and respective blocks now, thanks!

pjek’s picture

So what needs to be done now? My client want both Simplenews and Categories, how do I proceed?

lias’s picture

Yes, I could use this to. Will a new version with patch be added for download?

Thomas Sewell’s picture

StatusFileSize
new1.38 KB

See http://drupal.org/node/87669#comment-949328 for details.

The attached patch makes simplenews use $node->category instead of $node-taxonomy when the category module has it set. If the category module isn't setting $node-category because it's not installed, it will still use $node->taxonomy.

In what is likely related to upgrading instead of to this issue, I also had to repopulate simplenews_snid_tid from my pre-upgrade data.
insert into simplenews_snid_tid select * from <old_database>.sn_snid_tid;
If you are sending test newsletters ok, but have lost all your subscriptions for the real thing after upgrading, that may be the issue and solution for you.

sutharsan’s picture

#22 looks like a decent patch. If some people can test and confirm that this solves the imcompatibility, I am happy to commit it to simplenews. Does category clean up the $node->category when the module is disabled? Otherwise a module_exists('category') could be used.

reynaldio’s picture

is it really worth it installing category modules with all of these bugs?

JirkaRybka’s picture

Title: Simplenews won't create new newsletter on 5.0 dev version. » Simplenews and Forum broken due to missing taxonomy in node forms
Version: 5.x-1.x-dev » 6.x-2.0-beta2
Component: Miscellaneous » Wrapper modules
Priority: Normal » Critical
StatusFileSize
new1.29 KB

This bug still stands for the 6.x version of Category, at least for the Forum module compatibility (I don't use Simplenews): With Category 6.x-2.0-beta2, a new Forum topic is created, but don't show up in the Forum listing. This is because Forum module works with the Taxonomy element in node forms' submitted data, which is missing - hence no placement of new topic in the Forum listings.

The fix for 5.x was created by bdragon - the patch at #9 above is still valid for 5.x (I would call that RTBC, if I had the time to check whether it still applies to latest 5.x code). I run it on a production site (Forum+Category) for almost 2 years, works quite well.

6.x needs a similar fix, but it doesn't work in hook_nodeapi($op='validate') anymore, as we don't get neither $node nor $form by reference ( node_validate() is the culprit), so we can't modify that. But there's even better way available: Basically what we need to do is to clone form values from 'categories' to 'taxonomy' on submit, for other modules to recognize/process/validate. The earlier we do that, the better. So I added a hook_form_alter() implementation, which inserts a new validation handler to the node form, using array_unshift() to ensure that it fires as first one. This way, our handler is called just after illegal form values were checked, but prior to other modules' handlers, so they all get the taxonomy element.

This fixed the Forum problem.

Additionally, it also fixed the problem with Forum selection validation, where Forum's "Containers" are not allowed to be used. Without this patch, Forum accepts these illegal choices, having no taxonomy to validate (Problem #2 at #117172: Analysis: Forum). With patch the category selector is still not red-outlined (as the error was filed against a non-existent taxonomy element), but apart from that, the form doesn't validate and prints correct error message, so I think it's OK.

6.x patch attached.

Related:
- 5.x patch (might be RTBC) is #9 above (only fixes the basic problem, not Forum validation). (#25 is unrelated - against Simplenews module.)
- #117172: Analysis: Forum is a summary of compatibility problems (5.x), with more fixes. I didn't check that one against 6.x yet. EDIT: Checked now, IMO there's nearly nothing to do for 6.x in that issue, as long as this and the below get fixed.
- #464542: Restore the ability to have pre-selected category on node/add also needs to be fixed for correct Forum posting workflow.

Jaza’s picture

Status: Needs review » Fixed

Latest patch for the D6 taxonomy wrapper committed to HEAD. Thanks.

Status: Fixed » Closed (fixed)

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