Is it possible to subscribe a user to all terms with the same parent ?
maybe with rules ?

Comments

salvis’s picture

No, sorry, there's no support for that. You need to write a custom module and user interface. You'll also have to think about what happens when child terms are added later, and how to handle unsubscribing...

simoneb’s picture

ok thanks

which hook should I use ? _write_subscription and _delete_form_submit ?

salvis’s picture

Status: Active » Fixed

I'm not sure. Actually, I'm not sure we already have a suitable hook.

What exactly do you want to do? Have the user subscribe to the parent term and automatically create subscriptions to all child terms? Recursively, i.e. grand-children? Or enter one subscription to the parent term and queue notifications for all child (and grand-child?) terms?

Either way you probably have to hook_form_alter() the taxa subscriptions form, if only to add an explanation of how this works. If you do that, you can (option #1) remove (or keep, whatever...) the child terms, and you can replace (and then ultimately call) the submit handler, and simulate the user checking the child terms.

The second option is more difficult, because this is essentially done in one DBTNG call. You may be able to hook_query_alter() (D6: hook_db_rewrite_sql()) this call to replace an '==tid' condition with an 'IN (list of tids)' condition.

There may well be other strategies besides the two I've outlined above. That's why I don't think it makes sense to try to implement this kind of functionality in Subscriptions itself.

I will consider adding hooks if that's what's needed, but we'll have to add them to D7 first (i.e. you'll have to submit patches for D7 and D6). This is in your (or at least in your client's) interest, because it ensures that there is an upgrade path to D7 and beyond. Feel free to reopen this if needed.

simoneb’s picture

Status: Fixed » Active

From the subscription form all is ok, I've done the magic with jquery

it is the

http://www.mydomain.com/subscriptions/add/taxa/8947

form that I need to change. I want that, ifterm #8947 has children the user subscribe to all of them

es

8947
- 8999
- 8756
7854

if user subscribe to 8947 he subscribe to 8999 and 8756 also

I've tried to use this url

http://www.mydomain.com/subscriptions/add/taxa/8947+8999+8756

but it doesn't work

salvis’s picture

Status: Active » Fixed

subscriptions/add/taxa/% goes through subscriptions_add_form(), which posts to subscriptions_add_form_submit(), which calls hook_subscriptions_stype_alter().

So, you can implement that hook and call subscriptions_write_subscription() yourself for each desired child term and then let the submit handler do its thing.

Status: Fixed » Closed (fixed)

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