You should think about few general changes in your module. Altering of the 'comments' table is a very dangerous solution. You should create your own database table with nid, uid and email fields. The second thing is the sending of emails. In my opinion, it should be processed by cron. Consider my advices please.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Title: Bad conception » refactor data structure so core tables are not altered

I'm renaming this to a more descriptive title that contains just one problem. Please create a new issue regarding sending mail on cron.

Also, while I generally agree with the sentiment that core tables should not be modified I don't plan to fix this directly but instead have some ideas on other ways to change the module to handle your advice.

greggles’s picture

One more thought about this...currently the module uses some database specific concat/md5 functions to create a hash for unsubscribing users. If this were in its own table then it could have four columns:

cid|notification_hash|active

That way we can create the hash in php and create the link and the unsubscribe function in a more database agnostic manner (and probably a faster manner, since it is only calculated once).

greggles’s picture

Title: refactor data structure so core tables are not altered » refactor data structure so core tables are not altered and PostgreSQL compliance
Version: 5.x-1.5 » 5.x-1.x-dev
Assigned: Unassigned » greggles
Status: Active » Needs review
FileSize
10.94 KB

Here is a patch which attempts to do this. I'd love your help in reviewing/testing.

greggles’s picture

Minus the debug statements...

greggles’s picture

Title: refactor data structure so core tables are not altered and PostgreSQL compliance » refactor data structure so core tables are not altered and move towards PostgreSQL compliance
Version: 5.x-1.x-dev » 5.x-2.x-dev
Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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