Needs review
Project:
Notifications
Version:
6.x-4.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Oct 2009 at 09:34 UTC
Updated:
8 Dec 2011 at 22:51 UTC
I have a multilingual site. When I create a node, it is translated into 2 other languages. So I have an English, French and Dutch version of each node. When I user subscribes to be notified when such a node is created or updated, he gets 3 notifications, one for each language.
The user should only get one notifications in the language set in the user's profile.
Comments
Comment #1
adampdp commentedI have similar problem. When user A submits some content when viewing site in language X chosen in the language switcher, the notification is delivered to user B in language X no matter what the preferred language of user B. Any solutions would be great!
Comment #2
jose reyero commentedTo be considered for 4.x branch.
Comment #3
chirale commentedSame problem here. Plus, the current language that works fine with authenticated lan is not supported at all for anonymous users, falling back to site default (probably via user_preferred_language($account)) without setting current language into {notification} table (i.e. via language prefix).
In that case, even if notification will be submitted only for current language, mechanism will fail for anonymous users, since default language is used instead of the language of the page where the anonymous user subscribes.
Imo, a correct implementation should:
global $languageinstead of site default, the second correctly reading$account->language).$node->language.I try to look for a solution, but code seems too much wide and complicated for me. Changing
get_language()logic intoinclude/notifications_subscription.class.inchas no effect on {notification} table for anonymous users.If this feature will be implemented, a language policy setting could be useful in notification administration interface, something like:
Language policy:
Anonymous notifications language policy:
It's only an idea to explain language settings and open to further developement on language integration, that now is the weaker point of this very useful module.
Any idea how to implement these features?
Comment #4
ehanuise commentedsubscribe
Comment #5
liquidcms commentedi had duplicated this.. ooops.. will close that one.. and subscribing here.
going through code i see a few comments from Jose stating @todo for this... in 4-dev branch so far i have found/fixed (some) bugs in:
anonymous, custom, cck, and core notifications modules.. trying to fix all of them this week. and trying to add issues where i can but some of the bugs are simply obvious (like typos and missing args in switch statements, etc) - not sure i'll create separate issues for each of these and some i dont even know what the issue will be that they are causing.. but clearly are bugs...
Comment #6
liquidcms commentedlooking at this now and minor comment on #3 above:
i think should be "before queuing a notification" - important distinction.
part of my observations on this so far:
test case:
- 2 users, one EN and one FR (havent started looking at anon issues yet, that's next)
- edit an EN node (which is synced to a FR node so it updates as well)
- i get 2 Events created - one for the EN node and one for the FR node (this is good)
- i get 4 items queued (this is bad - the main issue reported here)
to note: the 2 Events are both tagged with EN, not sure where that fits into things just yet; but seems likely wrong.
Comment #7
liquidcms commentedthis is not likely generic enough solution but seems to be working for my test case, which is above.. plus,
my subscriptions are Custom Notifications based on taxonomy and node type (have only tested node type so far; but expect tax and type to work the same).
i have not modified any of the Notifications code (although it should be fixed), but i simply did this in an external module:
this basically modifies query select to it does not include items which do not match the subscriptions language (i.e. the language in the notifications table, i.e. the subscribers preferred lang).
this is using the drupal_alter that is provided in queue_event(), but could likely be added above as code above the alter to patch this module so people dont need to do the alter code in a separate module.
Comment #8
kapayne commentedsub
Comment #9
Vayira commentedI'm using 6.x-2.3 & I have this issue too with a dual-language site.
@liquidcms I'd be interested in knowing more how to apply your solution. Where in the notifications module would I need to insert the code? (Or if not possible, how would I create an external module?)
I'd say this is more the nature of a bug rather than a feature request, but I'd haven't changed it. Getting the language right is pretty important.