Closed (fixed)
Project:
Simplenews
Version:
6.x-2.0-alpha1
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
26 Apr 2010 at 08:19 UTC
Updated:
5 Feb 2011 at 06:00 UTC
Jump to comment: Most recent file
Simplenews integrates with the node form very well. It reuses the submit button to add further actions like test send or definitive send.
When working with (enforced) revisions this combination is pretty weird:
Even if you only like to send a test newsletter a new revision is added.
At least here we understand that sending newsletters has nothing to do with editing them.
We should add a new Tab "Newsletter" and put all datat/actions into this tab which is not directly node data.
Open for your inputs now!
| Comment | File | Size | Author |
|---|---|---|---|
| #38 | simplenews_781708_38_nodeapi_insert.patch | 1.32 KB | simon georges |
| #32 | simplenews_781708_32_nodeapi.patch | 1.49 KB | DrupOn |
| #29 | simplenews_781708_29_tab.patch | 29.05 KB | simon georges |
| #23 | simplenews_781708_23_tab.patch | 28.57 KB | simon georges |
| #19 | simplenews_781708_19_tab.patch | 27.77 KB | simon georges |
Comments
Comment #1
Thomas_Zahreddin commented#1
I totally agree!
Let's make the user interface nice and clean.
My customers always moan if the UI is cluttered - even when they are used to the options they sometimes want more options.
So ’hiding’ in a tab settings a user does not need to modify is a very good approach.
Comment #2
miro_dietikerRenaming to more representative title.
Comment #3
sutharsan commentedIn D7 development I made some changes that will help. I decided to move the newsletter email setting out of the newsletter node. In D7 these settings can only be set per newsletter category. According to my questionnaire receipt request and email priority are rarely used and I strongly doubt if html/plain is set on a per node basis. As a result we only have the Send and Send test options left in the node add/edit form.
Having the Send and Send test buttons/actions in the node add/edit form currently has some negative side effects: #758636: Preview button adds newsletter to spool, #795256: Mail Format settings gets lost when clicking preview first and this issue (#781708). Therefore I like to move these actions out of the node add/edit form. We have a few options: Use 'Send' and 'Send test' links below the node; Use a 'Send' tab; Use the Newsletter administration page to send (test) newsletters. Using tabs opens the interface for newsletter preview (#539742: Better Newsletter Preview). Using a page to send newsletters also provides a place to show a progress indicator when we decide to use the batch API to send newsletters (#742652: Use Batch API to send mails).
Comment #4
simon georges commentedJust so I am clear about what's to do :
hook_menu()to add the tabhook_form_alter()part of the node screen to a new formhook_nodeapi()part to a form_submit() functionAm I missing something obvious ?
I've actually been beginning the work, but it's a lot of refactoring regarding the node part (from one hand, it could be really good, by moving some part of simplenews logic outside of the node form, but on the other hand, half of the code would be moved, so I'm a litte bit worried of the consequences ;)). Anyway, if you think I'm not forgetting anything, I'll try to provide a patch as soon as possible, so people can test it deeply .
Comment #5
miro_dietikerThere's some more work needed to adapt rules / scheduler / service integration to trigger the send/test process.
I think i would like this as a start, especially for later progress bar implementation.
BTW: While sending we should output a warning if a user tries to edit a newsletter issue. We even could deny save in validate, but i think that's irritating.
Once we have a separate tab, we should even allow to cancel a send process (i think this should lead to a unrecoverable "cancelled" state... where only cloning helps to resend).
Comment #6
simon georges commentedOk... first patch.
It seems to be working, although I have not tested multilingual setup yet. The patch is huge, so I just wanted to have your feedback about it.
I removed the hook_clone_alter, as it doesn't seem to be need anymore (the node part works quite as a standard node, the simplenews part is now isolated).
Comment #7
miro_dietikerSounds great.
I'll review it later. Thanks!
Comment #8
simon georges commentedJust so you know, I just tested it with a multilingual newsletter, and it works, too.
It seems I just have a little theming problem (the English newsletter went well, but the french version had not the right theming, it seems, I hope you can help with that ;)).
Comment #9
miro_dietikerThat's cool news!
As always ... everything relies on my part. ;-)
Comment #10
miro_dietikerThe submission form now makes only sense to send / test send. There's absolutely no need to hit save without it.
So i'd remove the "don't send now" option
Since we'll use this tab after send also for further information, we might use a different Title.
Note the preview currently doesn't apply the node body filter.
I even wouldn't output the node content in this tab. Instead - like preview - i would much more add a confirmation page with a preview.
Can you please have a look at webform.module?
It has a very similar situation and i'd prefer to follow its UI implementation. They e.g. still stay with the node title on the Webform tab.
What do you think?
Comment #11
simon georges commentedI agree with removing the "don't send now" option, its current only purpose is to update the receipt / priority values, which is a pretty minor functionnality ;).
Regarding your point for the UI, I will try webform (just not tonight ;)). I'll keep you posted, thanks for the fast review !
Comment #12
miro_dietikerPlease don't forget to update the hook_help :-)
I just did an update on the help text...
Comment #13
miro_dietikerWhat do you think about the tnid (translated node) case?
I even thought about showing the send form of the tnid to send the full translation set instead of a dummy message.
We might even output a summary about the amount of current translations or the full translation set in the form.
Regular users don't have an understanding of a translation source. They're just two translations of the same newsletter.
Comment #14
simon georges commentedI totally agree with you, it makes no sense for a regular user. I'll display the form whatever translation of the node we're in. I think we can figure out what else to display later, maybe even after the release, what do you think ?
Comment #15
simon georges commentedNew patch (done on the current 6.x-2.x-dev version), with :
- node preview removed
- "don't send now" option removed
- same behavior for every language
Apparent issue :
- when using on multilingual setup, the two mails don't have the same output (the one on the current language is ok, the one on another language has visible html tags (so multilingual theming issue, apparently)
- the test e-mail is the one in the default language (but that's not introduced by my patch, as before, only the default language could send mails)
Anybody who's willing to test it is welcome ! Please report back on this issue the issues you found within this patch.
Comment #16
miro_dietikerThis is a visual review only. Not runned any tests.
FYI: If you use a test address with defined preference of the Language B, the user will receive the test language of Language B.
That's what the current ML behaviour as i'd have expected.
In the simplenews_admin_settings_newsl.. you're using numeric keys and not the constants.
I feel the new API for simplenews_update_newsletters is strange
- Please rename to simplenews_newsletter_update( ...
- pass parameter with a cleaner API.
All nodes have vids - not only translations. For the translation case you should check for $node->tnid (which is 0 if no translation set..).
Finally we need to decide if we log those information either per newsletter nid, or per revision (nid, vid). If vid is the primary key, then we should globally care about it.
Hard work! :-)
Comment #17
simon georges commentedOk, I've checked, and, indeed, when sending test to an existing subscription, the mail is sent using the language associated to the subscription, so that's still ok ;)
"In the simplenews_admin_settings_newsl.. you're using numeric keys and not the constants." : I've just adjusted the values consequently to my changes, but the function wasn't using the constants before. I could change that, I don't know if I should do that on the same patch, or if we keep the "cleaning" on a specific issue (we could to the
drupal_add_css()call on only the page thats needs it, not on every page, things like that).When tnid = 0,
translation_node_get_translations()doesn't return anything, so the node is sent instead. I load the vid on translation only, because in case of a node, it's already loaded bynode_load()(translation_node_get_translations()doesn't load the vid).I agree with your other remarks, new patch coming... when I have the time, probably tomorrow night.
Comment #18
miro_dietikerRight..
I see that it works correctly with the tnid. But if tnid==0, we shouldn't even call the API (get translation).
Note that translation_node_get_translations not even provides a return value... Let's just try to be clean.
Great progress.
Comment #19
simon georges commentedThe revision thing still needs to be figured out (where do we keep tab of revisions ?). Otherwise, I've added some of your remarks to the patch.
Comment #20
miro_dietiker:-) Looks better now.
Some further adjustments and we can roll it out once.
Wenn will you find time to check this issue again?
EDIT:
Please remove in simplenews_tab_node the drupal_set_title().
I'd change simplenews_tab_page to simplenews_node_tab_page.
And then tab_form to something like node_tab_send_form because of its send purpose..
Beside that i found no ugly side effect currently.
Comment #21
simon georges commentedToday & tomorrow, I really want to see that committed before taking off for the christmas holidays ;)
Comment #22
miro_dietikerPlease, please!
;-)
(BTW: see my edit above)
Comment #23
simon georges commentedNew patch, integrating your last remarks (#20) as well as use of constants in simplenews.admin.inc.
Do you have an opinion about what to do for revision management (maybe on another patch, this one begins to be big enough ;)) ?
Comment #24
simon georges commentedThere actually is #910970: revision handling broken.
Comment #25
miro_dietikerLooks fine to me.
Tested some trivial sends (no multilanguage) and it worked.
Note that nid becomes vid if revisioning is enabled. This has nothing to do with translation.
If translation happens, a node with nid has a tnid now pointing to the nid containing the translation.
So at least the text here is wrong: simplenews_newsletter_update().
I think we should remove the node_load() here...
So - some work remaining. ;-)
For a quick commit you could remove all vid related things in node and say: revision handling broken (again).. ;-)
Comment #26
simon georges commentedI agree we could remove everything related to vid, but that means changing a lot of the APIs, as vid are used everywhere in simplenews.mail.inc. So I think it would be a big whole other patch.
Regarding the the move into the tab, shoud I do something more ?
Comment #27
miro_dietikerI'm not talking about complete change of vid handling... (which should happen in separate commit)
I'm talking about this in #25:
The vid lines are completely wrong - at least their description. But i think we should remove them completely in this patch!
I'm fine with committing this patch as soon as descriptions are right and functionality seems OK for the cases previously worked.
(Revision handling excluded.)
Comment #28
miro_dietikerBTW: Do we still need hook_content_extra_fields()?
I think this is only needed to place the extra fields on the node form using the weights management of CCK UI.
Comment #29
simon georges commentedGood catch, Miro, I had not seen that one.
So, to sum up the current patch :
- remove the js
- move everything simplenews-related from hook_from_alter() & hook_nodeapi() to a complete different tab, with form, validate & submit callback
- remove hook_clone_node_alter() (as it's a simple node clone now)
- remove hook_content_extra_fields() (not needed any more)
- remove the "Don't send now" option, that does not make sense any more
- use constants in simplenews.admin.inc
Miro, I moved the lines regarding the node_load() to the submit callback, with a comment about data consistency, you were right (as always ;)), those lines were not really clear.
Let me know if you spot anything else.
Comment #30
miro_dietikerSimon... ALWAYS! ;-D
You might won't believe it but that all sounds perfect and i really like what i see as a result!
(Note i did NOT test this with applying the patch)
Thank you very much for this hard work. Please commit and let's see what will happen... ;-)
Let's wait 2..3 days before going Beta. I'll take the opportunity to test the result in production.
Comment #31
simon georges commentedCommitted... YAY !
Comment #32
DrupOn commentedPity this introduced another issue:
When i add a new newsletter the nodeapi op=insert is now missing.
Thus the record in simplenews_newsletters now is missing after inserting a new newsletter node.
Result is that the new issue now is missing in admin/content/simplenews
We need to add the entry..
Attached patch readds needed nodeapi lines.
Comment #33
simon georges commentedOh, you're right...
I see you've kept the "update" operation too. Is there a specific reason ? In case the content type is associated to Simplenews after the node has been created ?
Comment #34
miro_dietikerThis is needed because a newsletter issue might switch the tid.
Comment #35
simon georges commentedOk.
I'm in favor of using the new
simplenews_newsletter_update()function, to keep the code minimal (the existence check wouldn't be needed, as it is performed by the function) and coherent, what do you think ?Comment #36
miro_dietikerSure, i'm perfectly fine with that.
Do you find time to provide patch?
Comment #37
simon georges commentedSure, 'will do.
Comment #38
simon georges commentedThis patch uses the new
simplenews_newsletter_update()function.Comment #39
miro_dietikerLooks perfect. I'll commit later.
Comment #40
miro_dietikerfixed in dev.
Again needs some D7 port.
Comment #41
miro_dietikerSimon, we have a critical issue with this...
The tab issue needs clean rework and is a blocker.
Note that currently all node saves lead to updates of the newsletter. Currently this leads to a PENDING again after each save.
Also there are a bunch of side effects because the send command has no neutral and the newsletter save code always expects test send or full send.
Also the tab display only shows a message "has been sent"... (not differing for pending VS sent)
I'm already working on a suggested rework of this part.
Meanwhile users please note that the sending process and the node update workflow is broken!
Comment #42
simon georges commentedGosh, I knew from the start this wasn't gonna be easy...
Ok, so the first thing I see to make it better is only use "insert" hook_nodeapi() operation.
That way, no more unwanted updates. The update was needed in case of term changing. Maybe we can do a specific test for it, and only update this field ?
(By the way, the possibility to have different terms for translated nodes is strange, and I don't know how the sending process takes that into account).
Anyway, as you started to work on this, what can I do to help ?
Comment #43
miro_dietikerThat's a i18n issue - see i18nsync. We don't handle different terms.
Note the insert case is not enough since one could change the target term. We should not make term readonly on further edits...
Trying to fix it on my own first, u can help most with e.g. release notes.
(off: Do you know translators? We should trigger them.)
Comment #44
roball commentedSo alpha1 is broken. Wouldn't it be good to revert that patch for now and release alpha2 so we have a working alpha version?
Comment #45
miro_dietikerWithout this patch other things are broken...
We'll fix this asap, since i won't release a 6.x-2.x stable without this blocker implemented.
Comment #46
miro_dietikerAssigning
Comment #47
DrupOn commentedCommitted clean solution to dev in 7.x.
Backporting to 6.x-2.x.
Comment #48
DrupOn commentedCommitted new D6 version. D7 is much cleaner already... but this should work stable.
Comment #49
roball commentedCan confirm that this works now in the latest 6.x-2.x-dev (2011-Jan-19). Thanks!