Closed (fixed)
Project:
Simplenews Scheduler
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Feb 2012 at 08:59 UTC
Updated:
22 May 2012 at 15:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirHere is a patch that cleans up the checks (much simpler now), part of if was a left-over from the times when it was on the node edit form.
I also noticed that the sent edition case was completely borked and added tests for that as well.
Comment #2
joachim commentedI'm not really clear what this fixes. Do you mean parent or edition nodes? Could you give a quick bullet point list of what I should or shouldn't be seeing with & without this patch?
I've tried looking at both tabs of both a parent and an edition with and without the patch and I can't see anything changing... :/
Comment #3
berdirMost importantly, it fixes looking at a regular sent newsletter.
It should also fix the Newsletter tab of a sent newsletter edition and now show that this is an edition. The old code for this is dead because the most outer if already checks for it not being an edition so it is never run and that code was also broken because it tried to use an object as array.
This is possibly something that is broken in 6.x-2.x as well, see:
Neither is $title defined here, nor does the $form logic make any sense, it does set the #title property to an array consisting of type (note the missing #) item and another #title.
I don't think this is new code, so my assumption is that it's something that hasn't been touched in the port as it's never actually executed currently.
Comment #4
berdirDidn't mean to set it to needs work, bad Dreditor, bad ;)
Comment #5
joachim commentedah right, now I get it.
So:
- parent newsletter: no change
- edition newsletter: no change
- newsletter node that doesn't participate in scheduling: fixed.
I can see the fix now :)
Did you intentionally set this back to needs work? One point of my own:
- is the check for a regular newsletter node in isset($form['simplenews']['send']) ? could you add a comment above that line explaining the if() expression in a bit more detail please?
Comment #6
berdirYes, it mis-uses the fact that there is no send form element if the newsletter was already sent. That's ugly however, I'll replace it with a check that actually looks for the correct newsletter state, then the code should be much easier to read even without a comment (which I will add as well if it makes sense)
Comment #7
berdirDoing that check would actually be much more complicated. So I simply added a comment.
Comment #8
berdirGo for it, testbot.
Comment #10
berdirRe-rolled.
Comment #11
joachim commentedYikes, big patch!
I'd really appreciate a review from another user of the D7 branch :)
Comment #12
berdirThis is the same patch as before, just re-rolled.
Comment #13
joachim commentedCommitted, thanks.
- #1461152 by Berdir: Fixed scheduler fieldset displayed when not relevant.