Attached is a straight upgrade from CVS 2.67.2.3 (module version 5.x-1.1) to support Drupal 6.

http://drupal.org/node/112657 has become a critical feature to my use of the module, so it's rolled into this patch, too.

Comments

webchick’s picture

Status: Active » Needs review

This is a patch.

beginner’s picture

Status: Needs review » Needs work
zilla’s picture

has this been or will it be rolled into a dev version for d6 installation (or a beta)???? i hope so!!

zilla’s picture

hi, sorry to pester if that's what this feels like, but it seems like there's been a raw port of this module to d6 (per above comments) including a rollup of a patch that wasn't yet committed per the other discussion.

is there any official d6 dev version coming to the cvs? sounds like there's still an issue queue to resolve for the 5x release...

i can't write code, but i'm happy to assist with documentation if there's a need (for new features, general editing, whatever)

Salvatore Montefusco’s picture

After applied the patch, users' notify settings are not saved.
The function notify_user_settings_form has to be upgraded to drupal 6:

Convert the following lines:

function notify_user_settings_form(&uid = 0) {
  global $user;

  $account = user_load(array('uid' => $uid));

to:

function notify_user_settings_form(&$form_state, $acc) {
  global $user;

  $account = user_load(array('uid' => $acc->uid));

So it works, but the code should be cleaned (addressing the case when $acc is NULL?).

Scott06’s picture

Thanks for the work.

Could anybody make a official package for easy uploading to drupal 6? Dev, beta or final?

matt2000’s picture

Assigned: Unassigned » matt2000
Status: Needs work » Needs review

I've set up a dev snapshot for a D6 version based on this code. Please test & report back.

Standart’s picture

Version: master » 6.x-1.x-dev
StatusFileSize
new12.98 KB

I don't think this should have been committed as it seems to be a quick and dirty patch. Also it contains a new feature which doesn't have anything to do with the issue.

Anyway, I fixed the changes my patch for #148454 was supposed to do and did some code clean-up.

There was also a bug which gave me errors on flushing the queue. In _notify_send() the variable name "user" is used which seems to conflict with the global user as this global user is needed in Drupal 6 for user_access('access content', $user). I registered the global user in the function and changed the name of the other user to "receiver".

Attached is a patch agains 6.x-1.x-dev.

Standart’s picture

StatusFileSize
new9.65 KB

So, this thing about the user/receiver is not really true. I think it should be sufficient to remove the second argument from user_access('access content', $user) as it was in notify 5.x. I don't know why the original patch contains that argument but it fails because the local $user object doesn't contain the roles of the user that user_access needs. Without the argument it uses the global $user.

Corrected patch attached.

Standart’s picture

StatusFileSize
new11.67 KB

Drupal 6 gives us drupal_html_to_text which does everything that's needed to get plain text from HTML. It also includes wrapping, footnotes and even some basic formatting for <ol> and so on.

Attached is a new patch which uses drupal_html_to_text and removes notify_entities_to_utf8, _notify_entity_to_utf8, and _notify_mail_urls.

matt2000’s picture

patch applied. please test.

Standart’s picture

StatusFileSize
new997 bytes

Two minor corrections: I removed the $user parameter for all access checks in _notify_send(). It worked both ways because the checks are cached but it should be corrected.

matt2000’s picture

Status: Needs review » Patch (to be ported)
matt2000’s picture

Status: Patch (to be ported) » Fixed

patch committed

Anonymous’s picture

Status: Fixed » Closed (fixed)

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