Closed (fixed)
Project:
Simplenews
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2013 at 00:06 UTC
Updated:
6 Mar 2013 at 20:30 UTC
Jump to comment: Most recent file
Now that #1890718: Provide a default Entity source class is committed it makes sense to allow the mail spool to support different entity types. There is LOADS we could do here, but I think for now we should do the minimum possible to allow other entities to use the spooling system. Practically this includes:
This should mean that once mails are stored in the spool its simplenews can process them and send them effectively. We can work out how to easily add random entities to the spool in another issue as I realise there are many performance issues surrounding that (briefly mentioned in #1884290: Implement a pluggable system for who emails get sent to)
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | 1911322-any_entity_type_in_spool-21.patch | 21.09 KB | rlmumford |
| #21 | update.jpg | 53.53 KB | rlmumford |
| #17 | 1911322-any_entity_type_in_spool-17.patch | 20.88 KB | rlmumford |
| #14 | 1911322-any_entity_type_in_spool-14.patch | 20.88 KB | rlmumford |
| #12 | 1911322-any_entity_type_in_spool-12.patch | 20.88 KB | rlmumford |
Comments
Comment #1
rlmumfordHere's a first crack at this. Quite a few bits needed to be tweaked to pass tests (I'm still not sure I managed to fix all of them).
I don't like the way we work out the Simplenews source class to use. I wonder if we could store an 'simplenews source class' setting in the entity info?
Comment #3
rlmumfordComment #5
rlmumfordComment #6
berdirI'd just introduce a second variable with a key like simplenews_source_$type. First check that, with the Node one as default for nodes and then fall back to the global setting if there's no specific override.
Indendation of the array should be like this:
And the db_update() should have the fields() and execute() on a separate line.
Wondering if we want to continue supporting just nid here and then default to entity_type node for that.
The argument order is usually the other way round. Adding it and the end would only make sense if it were optional and default to node (but then it would have to be after $value).
Comment #7
berdirComment #8
rlmumfordHere's an updated version of the patch with the changes suggested above. I've continued support for the 'nid' flag as a condition although I am tempted to set a message saying that using it is deprecated and may be unsupported in a future version.
Comment #10
rlmumfordComment #12
rlmumfordComment #14
rlmumfordForgot to update the tests after swapping the arguments for issue count over.
Comment #15
rlmumfordSubmit it for testing
Comment #17
rlmumfordMissed one
Comment #19
rlmumford#17: 1911322-any_entity_type_in_spool-17.patch queued for re-testing.
Comment #20
berdirMaybe add a comment or two here to explain what we are doing, looks good to me otherwise.
Missing a . Need to check how this looks on update.php, docblocks on update functions should be kept short (single line) if possible.
Order of entity_type and entity in @params and function is not consistent.
Comment #21
rlmumfordI've applied the changes suggested in this patch.
This looks fine to me (image included). We could make it shorter although I feel it's the right level detail to explain what's going on.
Comment #22
berdirSorry for the long wait, this looks good. Commited.