Administrators may choose anonymous language preset for bulk subscriptions.
However, these values don't get updated later anymore and they're nor exposed to understand for an admin what happens nor are they editable.
In general, subscription data for anonymous users simply get too implicitly updated (or not) and the whole API concentrates on subscribing a mail to a list.
We should introduce an API to update the (list independent) mail properties and start outputting language data and more edit properties such as activation.
This patch contains some notes of things to check, introduces a simple api for language, calls it to enforce language switches on mass import and provides admins language information and switch capability. I really hope we can fix all the language related stuff very soon.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | simplenews_579202_14_language.patch | 7.02 KB | miro_dietiker |
| #12 | simplenews_579202_12_lang.patch | 8.94 KB | miro_dietiker |
| #8 | simplenews_579202-2.patch | 31.25 KB | miro_dietiker |
| #7 | simplenews.579202-1.patch | 6.53 KB | sutharsan |
| #4 | simplenews.579202.patch | 6.48 KB | sutharsan |
Comments
Comment #1
sutharsan commentedNice move :) I'll look into it.
Comment #2
dawehnerI think its better to write:
Update user data.
same.
same.
same.
same. :)
Ok its enough.
if ( Codestyle :p
why not use !$subscription->uid
indentation.
I'm on crack. Are you, too?
More review will follow..
Comment #3
mrath commentedHello,
I have tested the patch on a clean Drupal installation, with the required modules, and can say he perfectly functioned.
Comment #4
sutharsan commented* Why call simplenews_update_user() in simplenews_subscription_list_remove_submit()?
* Add Language to subscription admin page. Agreed.
* simplenews_update_user() Only update anonymous?
* Newsletter subscription must be as easy as possible. Therefore we should not place language selections in the subscription form. Users are subscribed with the current (not the default!) page language. Maintaining the language at the account maintenance pages is a right place.
A new patch is attached, like to have your comments.
Comment #5
miro_dietikerThanks for this cool update.
Looks promising.
At least there's one thing wrong while reading it:
$snid is the ID, not an array...
Updating the subscriber information always is much more flexible and proof of missing certain future updates..
And for the unsubscription there really seems no update required.
We're going to test this asap in deep detail.
Comment #6
miro_dietikerneeds work due to snid bug (missed transition)
Comment #7
sutharsan commentedI fixed the snid and added a tiny bit of documentation.
Comment #8
miro_dietikerSutharsan
I've taken your patch and checked many things and added some more - some new and some from previous patches.
(Sorry, my dev environment also included some formatting corrections :-S Also i added some additional code comments!)
You've deleted my language exposure in _manager but added it to user settings. I think this is wrong logic:
What we wanted is administrators to be able to edit language settings (of anonymous users) while users shouldn't be able to choose them: They choose language settings in their account and simplenews should rely on that locale setting.
However looging at simplenews_subscribe_user in the present situation it turns out that no language setting gets updated ever.
New code displays language selection as radios - corresponding to locale.module
Since _manager is being used for hook_user and administration forms we added a $context to detect the form we render.
One issue is we can't detect correctly that current user has "default" language but much more need to reduce it to concrete languages. Also locale.module does right this. (Also user_load and subscribers should do this).
Since we keep both in sync this is perfectly OK. To finalize this we might need some update script to set language to default site language if currently empty. Introducing "default" value would lead to a very complex situation.
_simplenews_subscription_manager_form still has code in it for block form rendering but is unused now. Right?
Do you now agree some more? ;-)
Comment #9
sutharsan commentedPlease make clean patches. Don't mix code style and other cosmetic changes with funtional changes. It slows down the patch reading and acceptance. Clean code style patches are no-brainers, mixed patches are a nightmare.
Comment #10
miro_dietikerAs you've pointed out, context is not what you want in _manager.
We'll redo the patch once we've split the form codes as latest state was in:
#683724: Hidden newsletters are visible
Sorry, the codestyle part was really accidential. Going to submit another issue for that for the obvious issues.
So let's concentrate on this big step forward to later on make cleaner and simpler solutions (for all other current open related patches/issues).
Comment #11
sutharsan commentedOk, for now we will drop the ability to modify the preferred newsletter language by the user and by the admin. Lets first get the underlying functions working properly. I agree that simplenews should follow the authenticated user's language selection. Admin import of email addresses should not override this.
Agree to set an explicit preferred language in the simplenews_subscription table and keep it in sync.
Comment #12
miro_dietikerI was sure i brought this in under 6.x-2.x...
I worked on the first part to add multilingual elements on lists. No saves yet due to form overhaul.
Committed attached patch as a step #1.
Comment #13
miro_dietikerneeds more work after:
#805114: Cleanup Form creation processes
Comment #14
miro_dietikerNow after form cleanup i've added settings in admin edit to change preferred language of subscriptions.
Patch also contains tiny other loading updates.