http://drupal.org/node/760414, have set it as support request unless someone else can confirm.

Comments

jose reyero’s picture

Title: Notifications Not Sent for Saved Searches Subscriptions » Notifications Not Sent for Saved Searches Subscriptions (Notifications 4.x)
Project: Notifications » Views Saved Searches
Version: 6.x-4.0-alpha1 » 6.x-1.x-dev

I don't think that module works yet with 4.x branch. I've contacted the module author to plan for this if possible

aron novak’s picture

The module will be upgraded within a week. Thanks for the notice.

bennos’s picture

Notifications 4 is in Beta 6 Version now. Any plans to support the Notification rewrite?

alexpott’s picture

StatusFileSize
new5.79 KB

I've got a version of the notification part of this module working for Notifications 4. It's pretty much a rewrite based on the needs of a site I'm working on - so I'm posting a tar.gz of the module rather than a diff - and at the moment there is no upgrade path :)

How is this different to the Notifications 2 version:

1. It only works with node views
2. It is written to work with a site with 20,000 saved searches... and runs on node insert and update - firstly it runs the view with no filters - if the node is not in that result set it doesn't bother doing any more. Secondly it groups saved searches by filter so it does run a view with the same filters twice.
3. It can override the views saved search form to provide a simple way of subscribing to a view.
4. You can optimise the filtering process further using hook_notifications_views_savedsearch_optimise_view_name.

eme’s picture

Well this is great work, especially the combination with notification 4.x : what did you change exactly?

I'm afraid there are some drawbacks in your method as well :

- even if it is optimized, if I understand well, it puts the load at any new content. So there should not be too many content added cause it'll run a lot of query. On the other way, if there is not many content, it is quite better
- the issue is that I'm setting a search (and not just filter). And the search engine needs to index before. So it is not possible with your module (with a quick fix it is possible with the previous one).
- you can only notify on nodes (not users etc.), which is not a major proble.
- if you write a draft, then it won't be published, and wen you'll publish it, there will be no notifications.

Remark : it depends on content notification (should be added to the .info file) interesting info for those who want to try.

alexpott’s picture

Hi eme,

1. The load on node_save... yep you're right that's why I've got an enhancement in mind to fix this and push the server load back to cron.
2. Node's not in search... well this would be fixed by my fix for 1.
3. I was actually thinking about making it easy to extend the module to support other types of objects that can be listed in a view.
4. If the node is published using the node_save function - which is the case for every way of publishing provided by default Drupal -then there will be notifications (in fact on my site that uses this work I use the workflow module and notifications only happen when a node's workflow is updated)

I'll update this issue when I've completed my changes... and I'll include a diff from the original module to it's easy to see what's changed... although the short answer to that is... a lot!

eme’s picture

Well, do not hesitate to post any changes as I'm working on it as well even if it is still buggy...so if I can help and test...

To be sure that the module is run at the right time (compared to search index for example and I think for notification module as well), I think we should put a weight to the modue in notifications_views_savedsearches_install (install file). Ex. :

  db_query("UPDATE {system} SET weight = 50 WHERE name = 'notifications_views_savedsearches' AND type = 'module'");

Other remark : maybe we should put the notification on update as an option as it is not clear everyone wants this (notification if you correct a misspelling for example...), either general, or at least in the nodes form (much more complicated), but then indeed we would have to check when the node is published for the first time.

Cron run is much better : I did not dig into all your code, but I think that maybe notifications_views_savedsearches_get_sids should run test on multiple entries (all new nodes) at once. Maybe this is a lot of work to implement, but it would be great from a performance point of view.

For my part, I added a table with two entries : type and item, with type for the moment always equal to 'node' and item equal to the node id with nodeapi hook. I then run cron, fetching all entries in the table (having moved the search from nodeapi to cron hook).

tyler-durden’s picture

eme and alexpott,
This may be the solution to my problem that I have spent nearly 10 hours trying to figure out. I have a few quick questions.

1) You state above the load is put on new content. With 500 to 1000 nodes created a day, I am assuming this is extreme for my case?

2) Most of the nodes created will be from the "Feeds" module, and I don't know if this uses the node_save function or not.

3) I think the only reason i would try to use the 4.x branch is for the anonymous or non-registered function in the 4.x branch. Is this even supported with this? If not, I may just look into the 2.x branch, but will I still have problems with #1 and #2?

Thanks!

eme’s picture

Well,

1) I would say yes...

2) I never used it but I think it does use the node_save (would be strange to see it inserting manually into the database for such a well known module!).

3) I think you should indeed use the current module for now. For your information, it puts the loads on cron run. So up to you if you have a heavy install to run cron during night, or low traffic times.

tyler-durden’s picture

Great, thanks for your input! I was already in the middle of playing with the 2.x module and loving it so far!

SchwebDesign’s picture

hello! Well it's been a year since the last post... and i'm in need of getting this working for Notifications 4.0 Beta 7. I haven't tested this but i noticed it looks like that's what you're posting above in comment #4 http://drupal.org/node/762392#comment-3550878 ...

...thus i'm thinking I need to try the version from comment #4... but that was posted October 9, 2010

...but i see the current version for Views Saved Search is 6.x-1.0-beta4 has a date of March 02 2011 which is more recent

Can anyone help me by confirming which of the following is true?

  • I need to install the version in comment #4 above for Notifications 4.0 Beta 7 compatibility
  • I can install the current Views Saved Search version 6.x-1.0-beta4 for Notifications 4.0 Beta 7 compatibility

Any response, help, advice would be appreciated. Thanks for this amazing module!