The Drupal 7 upgrade is a work in progress atm. The development has been moved to Github, http://github.com/josereyero/notifications. See also http://github.com/josereyero/messaging.

There's already a working version. Everything has been really simplified and we are trying to take advantage of the new Drupal 7 API so this won't be a plain upgrade. I will be posting here notes about the more important changes so this will be an upgrade log. The main changes so far:

* Events are now actions produced by Triggers (Like in Triggers and Actions). This reduces the complex logic in node and other hooks, and adds a great deal of configurability.
* Templates are hardcoded as classes that produce content for drupal_render(), as opposed to using a different template for each sending method. Then the sending method backend can format the array of data as it fits better for an email, SMS, etc.....
* Complex Queueing and Digesting has been taken out to two new modules (to be upgraded). Just very basic queueing (Drupal_Queue, one event at a time) remains.

There's no upgrade path yet from 6.x versions (work in progress at #1961850: Drupal 6 to 7 upgrade path).

CommentFileSizeAuthor
#54 notifications-5.2.patch1.96 KBtom friedhof
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

1) I think, since you are using entities, you can use Entity API. So you get a lot "for free".
2) we should talk about the future of og + msging. Are you on IRC?

sammyman’s picture

I just noticed that this module requires Autoload, which won't be ported to drupal 7. How can we install this for Drupal 7 without Autload?

pembeci’s picture

Any estimates when this will be ready for D7? Is the working version (proof of concept) version in github is ready to use in production sites? I am just trying to decide what version of Drupal I'll use for a new site and this kind of information will help me a lot in that decision.

Thanks.

sammyman’s picture

I dont think it is. I installed it and it still requires a module that hasn't been ported to D7.

Taxoman’s picture

Title: Drupal 7 upgrade » Drupal 7 upgrade task (Notifications module)

Subscribing.

Anonymous’s picture

I wouldn't use a pre-alpha version of a module on a production site, even an alpha or beta version is risky. If the module is buggy, you'll be relying on the hope of upcoming updates for your project.

It's like relying on someone that is completely unaware of your deadlines.

roychri’s picture

Will the final/stable version of this D7 port be moved back to Drupal's release system or will it always stay in github?

rorymadden’s picture

subscribe

David D’s picture

Subscribing

asb’s picture

sub

marko42’s picture

subscribing

twilkinson45’s picture

Is there a reason why this module requires PHP 5.3.* - my hosting provider is still stuck on 5.2.12

Mansie’s picture

subscribe

David D’s picture

I am on shared hosting, and my provider is running PHP 5.2.14. I discussed the prospect of moving to 5.3 with him, and according to him the problem is that there are known issues with PHP 5.3 and Drupal 6. As a result, he doesn't anticipate running 5.3 until such time as demand indicates establishing servers dedicated to Drupal 7 only (he provides Drupal-optimized hosting).

markwittens’s picture

@David D In my experience Drupal 6 runs flawlessly on PHP 5.3, there are some modules that might need to be updated but I have not had any problems besides that.

Then the real question: Why PHP 5.3? I found out it uses the function get_called_class() which is new in 5.3 but I also found a way to get it to work on PHP 5.2.x:

First open notifications.info and replace

php = 5.3

with:

php = 5.2

Then place this code in the notifications.module file:

if(!function_exists('get_called_class')) {
    class class_tools {
        static $i = 0; 
        static $fl = null;
       
        static function get_called() {
            $bt = debug_backtrace();  
           
            if(self::$fl == $bt[2]['file'].$bt[2]['line']) {
                self::$i++;
            } else {
                self::$i = 0;
                self::$fl = $bt[2]['file'].$bt[2]['line'];
            }
               
            $lines = file($bt[2]['file']);
           
            preg_match_all('/([a-zA-Z0-9\_]+)::'.$bt[2]['function'].'/',
                $lines[$bt[2]['line']-1],
                $matches);
           
            return $matches[1][self::$i];
        }
    }

    function get_called_class() {
        return class_tools::get_called();      
    }
}

It would be nice if this function was included in the release version so people "stuck" with 5.2 can use the module. It won't hurt people with 5.3 since it will only be used if the function doesn't exist.

David D’s picture

@markwittens, I believe the concern about Drupal 6 and 5.3 was indeed related to contrib modules, not core. So unless all 6.x modules have been updated to work with 5.3, it could easily cause grief to clients for a hosting provider to upgrade to 5.3. His concern seems entirely reasonable to me.
Thankfully, your code apparently solves the problem. Very nice! I do hope it gets incorporated into the release.

teh_catt’s picture

I also need to use this module with Drupal 7 but am stuck with php 5.2.17

I opened the notifications.module file but found no reference to php = 5.3 anywhere. Is this fix for the d7 version?

*EDIT - realised the php reference is in notifications.info not notifications.module, edited this and now it lets me install the module.

Fine work sir hope this one gets included in the next release.

markwittens’s picture

Sorry about that, I edited my post so others won't have this problem.

pillarsdotnet’s picture

Component: Miscellaneous » Documentation
Category: task » bug
Priority: Normal » Major
Status: Active » Needs work

The github links are broken.

lurchdog19’s picture

subscribe

Jose Reyero’s picture

The project is back on Drupal git btw.

lurchdog19’s picture

Yes they have been broken for a couple of weeks now. Its still not working though.

Thanks a bunch!

mfer’s picture

Priority: Major » Critical

Since most hosting environments are currently on PHP 5.2, this incompatibility of versions is a pretty big issue. Upping to critical.

extrarumeno’s picture

Subscribe

Most hosting has version 5.2

Taxoman’s picture

What are the main reasons of requiring PHP 5.3 at the moment?
(or what was the rationale behind making that requirement in the first place, when it was originally made)

marko42’s picture

subscribe

teh_catt’s picture

I got the module installed but cant seem to subscribe to any content types? I have enabled them and the actions and triggers are in place but when I go to the content-type sub-tab on the notifications tab of my profile it just says no subscriptions are available. I can't see any way to subscribe to a content type anywhere else.

Any help gratefully appreciated.

lurchdog19’s picture

Hey Teh_catt, Not sure if its me, but the only way I found to subscribe was adding the block and then I see subscribe to this content. Very different from when I used the "Notify" module which was much simpler for what I needed it for. I still cannot get email notifications working though. one step at a time I guess.

Maybe you can help with this, when i look at the modules I see Job_scheduler_trigger (missing).

Notifications scheduler 7.x-1.0-alpha1 Configurable scheduler for Notifications.
Requires: Notifications (enabled), Messaging (enabled), Trigger (enabled), Messaging template (enabled), Job_scheduler_trigger (missing)

Thoughts?

illogicz’s picture

can't seem to get email notifications to work

AndrzejG’s picture

Subscribe

dmadruga’s picture

+1

tonycpsu’s picture

Subscribing

webankit’s picture

+1

Starminder’s picture

subscribe

merlin2288’s picture

I'm also working to resolve this same issue and seem to have the same problem which at this point is:

1. the "job_scheduler_trigger" missing
2. no email being sent when it should be (subscribed to send messages when new articles are added)

I was able to subscribe to all articles by an author by clicking on their avatar which is displayed by all the articles they've posted. Not sure how to subscribe to a specific content type (article).

I have modified the module and info files as directed by markwittens above (thank you) which gets me one step closer, but just not all the way.

Keep the faith... many of us would like to get this resolved.

achton’s picture

Subscribing.

lloydpearsoniv’s picture

job scheduler trigger work lives here https://github.com/developmentseed/job_scheduler_trigger

more info can be found here #931568: A few features to work on for D7

stg11’s picture

subscribing

sjugge’s picture

sub

Dane Powell’s picture

sub - very interested in a complete and working notifications/messaging d7 port

merlin2288’s picture

I hear ya... I'm not interested in a ton of the features. I just want to know when someone adds an article to the site or when someone comments on an article. If anyone has that little bit of functionality working please let me know as I'd love to chat with you and figure out what I have configured incorrectly.

Thanks

PGO’s picture

subscribe

JGonzalez’s picture

subscribing

merlin2288’s picture

Forgive me for my lack of knowledge regarding the class declaration and the overall architecture of Drupal, but I noticed that the error message I'm receiving (shown below) when I attempt to edit my subscriptions is related to the workaround provided in #15 above (thanks markwittens).

Error: "Fatal error: Call to undefined function get_called_class() in /home/d3drup4l/public_html/sites/all/modules/notifications/notifications.list.inc on line 266"

I looked at the "notifications.list.inc" file (the code pictured below appears at line 246) and can see 2 occurrences of the class "get_called_class". Seems like the change detailed above gets the Notifications module to validate, but the functionality isn't carrying though. Anyone have any ideas on what needs to be done to correct this error and get things on the right track?

/**
   * Build subscription list instance from object or array of subscriptions
   */
  public static function build_list($items) {
    // PHP 5.3.0 only, we may want to construct another class extending this one
    $class = get_called_class();
    if (is_a($items, $class)) {
      return $items;
    }
    else {
      $list = new $class();
      $list->add($items);
      return $list;
    }
  }
  /**
   * Build subscription list from array of sids
   */
  public static function build_sids($sids) {
    // PHP 5.3.0 only, we may want to construct another class extending this one
    $class = get_called_class();
    $list = new $class();
    $list->load_multiple($sids);
    return $list;
  }

Thanks

plastikkposen’s picture

merlin2288: If I understand you problem correct... It is already possible to send a mail when someone adds an article or a comment with the drupal core modules "trigger" and "actions". No need for notification module for that. Check the drupal documentation on this :-)

ryandao’s picture

Hi, I'm using the D7 alpha 1 version. I would like to know whether the thread subscription feature is completely ported to D7. I appears to me that autocomplete field still uses the deprecated function db_rewrite_sql. I'm building a module for my company that makes use of that feature from Notifications. Really appreciate if anyone is available to help resolve the problem.

Dane Powell’s picture

Status: Needs work » Fixed

Now that a dev release is actually out, we should close this issue and spin off any bug reports / tasks / support requests into separate issues. Please, if you posted such a request in this thread, start a new issue. Thanks!

ryandao’s picture

Thanks Dane, I've created a new issue here http://drupal.org/node/1189988!

plastikkposen’s picture

Hi. Why are the github links (still) broken? Where can this DEV version be downloaded and tested?

Thanks

Dane Powell’s picture

Uh- from the project homepage, where else?

plastikkposen’s picture

Dane: Let me rephrase. Yes, I can see the the latest dev version is from 25th february 2011. Your post #47 from june 15th implies there is a newer dev-version out, and I could not get the github links to work. Thought I've missed something. No big deal, was just eager to test. :-)
-cheers

Dane Powell’s picture

Sorry, I didn't mean to imply that a newer dev release was out- just that there was in fact a dev release. In which case, we should be logging issues against that release. The only reason to keep this thread open is for meta- / strategic planning- I just worry that it's going to quickly become bogged down with issues that rightly belong elsewhere.

Sorry for any confusion.

Status: Fixed » Closed (fixed)

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

tom friedhof’s picture

FileSize
1.96 KB

Here is a patch for the suggested fix in #15. That worked for me.

Dane Powell’s picture

Hi tom, thanks for the patch- please post it in #1209932: Notifications / Messaging PHP 5.3 requirement and let's continue any further debate about the merits of requiring 5.3 there.

Wolfflow’s picture

Sub agree on #16

Jesuscares’s picture

Title: Drupal 7 upgrade task (Notifications module) » Drupal 7 upgrade task (Notifications module) - Can't get UI to work
Category: bug » support
Priority: Critical » Major
Status: Closed (fixed) » Active

I cannot get the UI to show for Admin nor for registered users.
I simply want registered users to be able to set a checkbox to allow them to get email when someone updates a forum topic or a comment to a forum topic.

I am using drupal 7 and the latest Message and Notification versions as of 2011-09-03

I have the following modules turned on:
CHECKED: Messaging
CHECKED: Messaging template
CHECKED: Simple mail (note: a test email does work)

I have the following Notification modules turned on:
CHECKED: Content Notifications
CHECKED: Notifications
CHECKED: Notifications UI
CHECKED: User Account Tabs (I don't think I need this, but turned it on to try to get the UI to show up)
CHECKED: User subscriptions (I'm not certain I need this)

I have the following moduled UNCHECKED:
UNCHECKED: Notifications Scheduler (because it says it depends on Job_scheduler_trigger (missing) - but I don't know where to get that)
UNCHECKED: Notifications Taxonomy - I don't want them to be able to get notifications by content tags, so I don't think I need this.

I read in some places that the Token module might be needed, but I don't want that functionality I don't think.

Any help appreciated.
I was wondering about the following:
1. Do I need to add a "field" to the content for forums or forum comments? If so, what field?
2. I notice if I go to "http://ourURL.com/node/7#overlay=admin/structure/types/manage/forum" it has a link for "notification settings" and it has checkboxes for "Allowed subscription types: Thread, Content type, Author, Content type by author" but then at the bottom it says: "Enable different subscription options for this content type. To enable these options check the Notifications content settings" When I follow that link to "http://ourURL.com/node/7#overlay=admin/messaging/notifications/content" there are links for "Dashboard" "Content" "structure" "appearance" "people" "modules" "configuration" - I don't understand why those checkboxes can't be checked and how to turn them on!

Taxoman’s picture

Title: Drupal 7 upgrade task (Notifications module) - Can't get UI to work » D7 upgrade task (Notifications module)
Category: support » task
Status: Active » Closed (fixed)

#57: please don't hijack this issue, file your question as a new issue in the 7.x branch. This one is closed.

Jesuscares’s picture

Ok, I didn't realize where to file it. I put it over here: http://drupal.org/project/issues/notifications

Taxoman’s picture

tassaf’s picture

I want documentation for using hook_notifications in drupal 7

rpeters’s picture

Markwittens, where do I put the code?Thanks

Media Crumb’s picture

Has the development of this port stopped? If so are there any alternatives atm for D7?

fen’s picture

Has anyone tried the upgrade? The tables are largely similar, it might not be that difficult. (Unless I am missing something.)

vasrush’s picture

jetwings’s picture

Hi all,
I have an issue.
Currently I am running a Drupal (articles+forum+blog). (Drupal version: 6.x)
I am also using Notifications. (mainly for the forum posts replies/follow)

But not able to upgrade to Drupal 7 because Notifications is not available yet for D7.
Can somebody suggest some alternative. I need the email notification of reply/new comments to work also for existing posts/topics also.

Thanks in advance.

tassaf’s picture

You can use message module
http://drupal.org/project/message

But before using it check if they finished using queues with this module so that it supports huge number of users

Owen Barton’s picture

I have created an issue for the 6 to 7 upgrade path at #1961850: Drupal 6 to 7 upgrade path together with some prototype code.

Owen Barton’s picture

Issue summary: View changes

Adding upgrade path link

Hawkcode’s picture

Issue summary: View changes

Hi,

We have a D7 site and want to add Notifications. All I'm finding is Upgrade Path, what about a new install?

Where can I find that?

Thanks

Rich

mchampsee’s picture

I'm having an issue that I'm looking for paid help for...we have notifications running and it doesn't work in production, but does on a dev instance that we have. Had been working for some time without issue.