Drupal 6 Support

Jorrit - April 11, 2008 - 19:07
Project:Simplenews Roles
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

This module has to be converted to Drupal 6. I have attached my working version for this. Please check if this can be useful.
It has the added feature of removing footers for lists that are role-based. An unsubscribe link is pointless here.

#1

Sutharsan - April 13, 2008 - 12:11

attachment is missing

#2

Jorrit - April 13, 2008 - 12:33

I'm sorry for that

AttachmentSize
simplenews_roles.module 5.07 KB

#3

JuLearn - October 18, 2008 - 08:24

Thanks a lot to Jorrit!
Trying to activate, I get the message
"This version is incompatible with the 6.5 version of Drupal core"
Any hints?

#4

Jorrit - October 18, 2008 - 09:17

You have to edit the info file as well, add something like core = 6.x. I don't know exactly anymore, look in other info files.

#5

JuLearn - October 31, 2008 - 10:54

Yes, I edited simplenews_roles.info. But not enough. With a reduction to

name = Simplenews Roles
description = "Automatically subscribe users in designated roles to a newsletter list."
package = Mail

project = "simplenews_roles"
core ="6.x"
it is running now. I am going to test it.

#6

Babalu - November 2, 2008 - 18:03

subscribing

#7

zilla - November 26, 2008 - 15:29

is this converted version working? possible to move to project page for more testing?

#8

trophaeum - December 3, 2008 - 17:39

subscribing

#9

kwgossett - December 21, 2008 - 19:17

subscribing

#10

rhache - January 19, 2009 - 05:03

subscribing

#11

kenorb - January 19, 2009 - 23:32

+1

#12

tobiass - January 23, 2009 - 12:28

subscribing

#13

ron_s - January 24, 2009 - 01:12

I attempted to use your module. If I sign on as a user, go to the user's User Profile > My Newsletters, and attempt to unsubscribe from the newsletter, I get the following error messages:

    * warning: array_keys() [function.array-keys]: The first argument should be an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 107.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 109.
    * warning: array_unique() [function.array-unique]: The argument should be an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 109.
    * warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 112.

#14

Valeratal - February 12, 2009 - 07:41

subscribing

#15

eff_shaped - March 17, 2009 - 14:14

subscribing

#16

Axel Pressbutton - March 21, 2009 - 23:43

Also subscribing

#17

encho - March 31, 2009 - 10:55

Subscribe

#18

iaminawe - July 13, 2009 - 13:15

subscribe

#19

BSLFE - July 14, 2009 - 04:32

@#13, ron_s:
This error occurs because there is no checking whether the "$edit" array actually has a "roles" array which it might have gotten from the form being used.

I have had another problem with the "simplews_newsletter_footer" theme function. Appearantly there already is such a function in simplenews and simplenews_roles tries to re-register the function. I have simply renamed the function "simplenews_roles_newsletter_footer" which got rid of my problem. However I have not tested yet whether this theme function is absolutely necessary.

Also, I have added a call to "simplenews_unsubscribe_user" for those users that don't have a matching role id for the current subscription. I know that this might be redundant because a sync is made before a newsletter is sent. However, this makes sure that when you manually remove a role from a user the subscription for this user will be deleted.

I have done two identical patch files, the one expects the filename to be "simplenews_roles.module.txt" (like uploaded above) while the other expects it to be "simplenews_roles.module" (like it might be in an installed module)

I have not done extensive testing yet so please be sure to use this at your own risk!

Feedback would be appreciated! I also plan on adding an opt-out feature so that once you opted out you won't get subscribed again even if you do have the specific role(s).

AttachmentSize
simplenews_roles.module.patch 1.95 KB
simplenews_roles.module.txt.patch 1.95 KB

#20

watersevenub - July 18, 2009 - 15:39

"Feedback would be appreciated! I also plan on adding an opt-out feature so that once you opted out you won't get subscribed again even if you do have the specific role(s)."

Right now, when a user opts out, what action will trigger his re-subscription? Ot the newsletter just gets sent to him anyway?

(Could you post an updated module with patches applied? Any ETA for the feature above mentioned? Thank you)

#21

vacilando - July 21, 2009 - 17:43

Subscribing

#22

joachim - July 22, 2009 - 13:49
Status:active» needs review

Changing status + subscribing.

#23

joachim - July 22, 2009 - 14:21

Works for me.

Here is the complete module from #2 with the patch from #19 and my changes:

static $role_newsletters;
// let's cache this.
if(!isset($role_newsletters)) {
$role_newsletters = variable_get('simplenews_roles_tids_rids', array());
}

There is no point in caching a variable_get. All variables are already cached by Drupal core.

No idea what is going on in simplenews_roles_nodeapi:
// Strip out non-Simplenews terms from taxonomy for posterity.

Added some missing function doc headers and made a few code style cleanups too :)

AttachmentSize
simplenews_roles.zip 8.21 KB

#24

joachim - July 28, 2009 - 09:13
Status:needs review» fixed

I've been given maintainership of this module, so I've gone ahead and committed the above (with a slight fix in my version of the info file -- I messed up the dependencies line!)

Thank you everybody for your hard work!

This should be available soon as a -dev version. Please test this further and report any bugs!

#25

joachim - July 27, 2009 - 22:54

BTW, @BSLFE: if you're still interested in working on an opt-out feature, see #331080: unsubscribe reverts back after cron run.

#26

eff_shaped - July 28, 2009 - 08:40

@joachim - THANK YOU!

#27

Jorrit - July 28, 2009 - 08:52

Thanks :) Also thanks for all the people who took the effort to publish their patches.

#28

System Message - August 11, 2009 - 09:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.