I'm keen to integrate this into the Answers module. However, am running into a problem.

I receive this error ...

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM subscriptions s WHERE (module = 'node') AND (field = 'field_srt_parent') ' at line 1: SELECT FROM {subscriptions} s WHERE (module = :db_condition_placeholder_0) AND (field = :db_condition_placeholder_1) AND (value = :db_condition_placeholder_2) ; Array ( [:db_condition_placeholder_0] => node [:db_condition_placeholder_1] => field_srt_parent [:db_condition_placeholder_2] => 1 ) in subscriptions_get() (line 677 of D:\xampp\htdocs\drupal_7\sites\all\modules\subscriptions\subscriptions.module).

... when I create a child node which refers to a parent for which I set a "node" subscription.

I've attached a simple module which I used to test Subscriptions Reference. It defines a parent node type and a child node type. When I create a parent, then subscribe to it, then try to create a child, I get the above error.

In case it helps, I've attached the simple module I've used.

CommentFileSizeAuthor
srt.zip3.12 KBchipcleary

Comments

bulat’s picture

Assigned: Unassigned » bulat
Status: Active » Needs work
bulat’s picture

Can you please check if patch from #1853644: subscriptions_get generates pdo exception solves it.

bulat’s picture

Status: Needs work » Closed (duplicate)

feel free to reopen if still having problems.

chipcleary’s picture

Yes, this fixed it. Thanks!

bulat’s picture

In terms of using this module for Answers I would strongly recommend looking at Message module. It provides a better architecture and API. We started by writing subscriptions_reference, and than had to switch to Message in our project. If you are interested I can contribute some code samples from our project in corresponding Answers issue.

hussainweb’s picture

@bulat, I am already using subscriptions in my project and I am not sure if I want to switch entirely to message stack of modules. Does message work seamlessly with subscribe?

bulat’s picture

@hussainweb, recommendation in #5 was for answers module, where notifications are build from scratch. If you already have subscriptions than this module is great.

hussainweb’s picture

I should have mentioned that I was also looking to integrate with the answers module. I already have subscriptions working and live with other regular content and that is why I was looking to reuse.

Anyway, it seems I have my answer. I will continue building on this module. I have posted some issues and patches for them too.