Closed (fixed)
Project:
Simplenews
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 May 2019 at 16:28 UTC
Updated:
30 Jun 2019 at 10:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
berdirSee comment in #3054695: Problem with recipient handler interface and spooling about the views-based recipient handler which I think wouldn't be possible with this and the related issue?
Comment #3
adamps commented@Berdir #2 - yes I agree.
Comment #4
adamps commentedNB Patch applies on top of #1931006: Problem with recipient handlers so it won't apply until that one is committed. However it is still possible to review.
Comment #5
adamps commentedComment #6
adamps commentedComment #8
adamps commentedComment #10
adamps commentedComment #12
adamps commentedComment #13
adamps commentedComment #15
adamps commentedComment #16
adamps commentedComment #18
adamps commentedComment #20
adamps commentedComment #22
adamps commentedComment #23
adamps commentedComment #24
adamps commentedComment #25
adamps commentedComment #26
jonathanshawDoes this want an update hook? As you've removed the code from NodeTabForm, the module is effectively useless without the widget enabled.
So we're keeping the NodeTabForm but moving the settings out of it.
I think that it's right to put all the settings into the one widget, for the reasons you give on the IS.
But having those settings live somewhere else other than the NodeTabForm where the sending happens is a bit of a weird UX.
I suggest a follow-up issue to look at something like adding a 'simplenews' form mode for the node entity, enabling the issue field widget by default only on that form mode, and using that form mode on the NodeTabForm.
We don't seem to have preserved this ability for recipient handlers to validate or respond to submit.
As I understand it the normal Drupal paradigm for plugins that provide forms is that they have build, validate and submit methods.
So maybe we should add these to the RecipientHandlerInterface and empty implementations to the base class.
Core has a PluginFormInterface, so maybe RecipientHandlerInterface should extend that.
This is a pretty complicated approach to getting the handler id ... if there's a really good reason to do this rather than just loading the value stored in the field, maybe it's worth making a code comment explaining.
If it worth hiding or disabling the handler if there is only one option?
Hard to describe this. Some possibilities:
"Select how recipients are identified."
"How recipients should be selected."
"Choose which procedure to use for selecting email recipients."
Wow, that's an arcane drupalism. Might be worth making a comment linking to #2448545: Modernize form select option helpers and/or #1585930: Render the _none option as an empty value for single select to allow client side validation for explanation.
Comment #27
adamps commented1. I think it's OK without an update hook. If the specified widget is not available, then Drupal uses the default instead - which is exactly what we want.
2. I see your point that people might prefer to have configuration of the destination on the same page as the send button. However that's not how it is now we are not creating a new problem. Feel free to raise an issue. I'm not sure exactly how we could approach it - there are potential difficulties. As discussed in the IS, the destination must be set on the edit page or else sending via an action is broken. I'm not sure how easy it would be to somehow merge a node edit form with the send form. A new form display mode feels perhaps a bit too much as NB it would appear for all content types.
3. We match WidgetInterface which does not have verify and submit methods. The code in
settingsForm()for building the form should add verify/submit handlers in the normal way.4. I added a comment. If you can see a simpler way of doing it then please post your code:-) NB I don't want to hard-code the name of the field into the widget - I'm trying to gradually move away from the "magic field name"
simplenews_issue.5. Yes that's what the code already does:
6. Done.
7. I added a comment to explain how it works. I felt that was more useful than linking to an issue that is about changing how it works.
Comment #29
adamps commentedComment #31
adamps commentedSorry first commit missed the added file - now corrected
Comment #33
adamps commentedSorry bad merge - now fixed