I'm working on a module to allow subscriptions to books. A subscription to a book will produce notifications for:

- changes to the book node itself
- changes to any node within the book
- new nodes added to the book

The subscription link appears on all nodes in the book.

Comments

joachim’s picture

Status: Active » Needs review
StatusFileSize
new4.95 KB

Here's the patch.

A few things I've not managed to figure out:

- the incoming $node in a couple of hooks was sometimes missing a $node->book property. Is there a hook somewhere else where it should be loaded in? I couldn't work this out, and it wasn't always missing, so I added a node_load() and an explanation for the apparent
- I was hoping to provide alternate templates for messages that are the result of a book subscription, but I cant find if that's actually possible -- see #1302460: does not seem possible to define or set templates by subscription type. I didn't think that adding a new type of event was the right thing to do, as these are still fundamentally node creations and updates -- you'd end up with two different events firing for the one user action which didn't seem right when it's really the same one.

mikebell_’s picture

Status: Needs review » Needs work

When using this patch we get the following:

Parameter 2 to notifications_book_notifications() expected to be a reference, value given in /home/quickstart/websites/bronetest.dev/sites/all/modules/messaging/messaging.module on line 1242.

Seems like it's not liking the reference on line 27 of notifications_book.module.

mikebell_’s picture

Status: Needs work » Needs review
StatusFileSize
new4.95 KB

After speaking with Joachim the pass by reference isn't needed so here's an updated patch that doesn't include it.

IGNORE - patch doesn't work as expected.

mikebell_’s picture

Finally decided to re-tackle this and get the patch right.

mikebell_’s picture

Last patch to fix another reference issue.