Closed (fixed)
Project:
Simplenews
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 May 2019 at 11:56 UTC
Updated:
28 Jun 2019 at 12:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
adamps commentedHmm it's tricky in NodeTabForm. The count depends on the choice of recipient handler and settings, so would need to be updated by Ajax.
It seems that data is being collected in the wrong place. Newsletter ID is set when editing the node. Recipient handler feels exactly like newsletter ID but is set on the newsletter page.
Comment #3
adamps commentedI have raised #3055850: Wrong location of recipient handler UI for the related issue.
Comment #4
adamps commentedNB
1) There is some existing caching that we should keep for good performance. The default recipient handler can implement a cache of newsletter_id => count. For other recipient handlers, the count may depend on values in the issue entity in which case they cannot do the same caching.
2) Remove
simplenews_count_subscriptionsor refactor it to call the default recipient handler.Comment #5
adamps commentedComment #6
adamps commentedComment #7
adamps commentedThis patch applies on top of #193100: Creating Playlists using swftools_prepare_playlist_data. However review comments are still welcome.
Comment #8
adamps commentedComment #9
adamps commentedComment #10
adamps commentedComment #12
adamps commentedComment #14
adamps commentedComment #15
adamps commentedComment #16
jonathanshawWouldn't this more naturally be a property rather than a method? Or do you imagine situations where its value is determined dynamically rather than by the developer?
doCount should be protected not public?
Comment #17
adamps commented1. Personally I prefer a function because it is more flexible and more rigorous (it prevents accidental overwriting of a property value). I guess it's perhaps a matter of opinion. Seeing as I have written and tested it this way it doesn't really seem worth changing.
2. Done (*3)
Comment #19
adamps commented