Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I'm not a php expert (by a long way) but I've been trying to hack together a solution for the DST problem.
The following code does not work, but I'm hoping that some drupal/php guru may be able to point out where I'm going wrong:
Inserted into node_repeat.module:
if (isset($date_diff)) {
$end_date = date_make_date($dt, $date_tzdb);
date_modify($end_date, '+' . $date_diff . " seconds");
$field[0]['value2'] = date_format($end_date, $date_format);
}
becomes:
if (isset($date_diff)) {
$end_date = date_make_date($dt, $date_tzdb);
date_modify($end_date, '+' . $date_diff . " seconds");
if ( date_format(date_make_date($start_date, $date_tzdb), 'I') && !(date_format($end_date, 'I')) ) {
date_modify($end_date, '+1 hour');
}
elseif ( !(date_format(date_make_date($start_date, $date_tzdb), 'I')) && date_format($end_date, 'I') ) {
date_modify($end_date, '-1 hour');
}
$field[0]['value2'] = date_format($end_date, $date_format);
}
I thought that this would compare the dates of the original and repeat nodes, and that if one was in DST and the other wasn't that it would +/- 1 hour as necessary.
But it doesn't
I suspect that I am not understanding drupal's date management (or maybe even php's).
I hope that some expert can help sort this out.
Comments
Comment #1
MasterChief CreditAttribution: MasterChief commentedI think it's the first problem you may fix gargarine because it's a real problem.
abursni maybe the guys who work on the Date module could help, but just for information, i have 2 hours between the real date and the second date time make by Node Repeat.
Comment #2
gagarine CreditAttribution: gagarine commentedThanks for the report.
Please witch version of PHP do you use?
MasterChief do you have the same problem?
Comment #3
gagarine CreditAttribution: gagarine commentedComment #4
MasterChief CreditAttribution: MasterChief commentedI have php 5.2.11
Yes i have the same problem, olivercoleman spotted the problem, here his comment on the module page :
I don't know how he managed date.
But it's a real problem.
Comment #5
gagarine CreditAttribution: gagarine commentedThank to confirm.
The support request on date project #993630: date_repeat_calc not adjusting time for DST in repeat sequence
Comment #6
gagarine CreditAttribution: gagarine commentedI played with this module today and study http://drupal.org/project/date_repeat_nodegen.
The creation of node is more elegant with nodegen. I asked the maintainer for a fusion. This will be more a refactoring but will close this issue as a side effect.
The interface will change by using the standard date repeat widget directly in the node creation. Tell me if this UI change can be a problem...
Comment #7
MasterChief CreditAttribution: MasterChief commentedI don't think it's a problem.
Did the maintainer of the other module answers you ?
Comment #8
gagarine CreditAttribution: gagarine commentedNo answers :(.
Perhaps it is a bug in date #1008244: Dates sotred in database add/substract daylight saving time (DST) instead of using UTC or at least in documentation.
I will create a quick fix for the 6.x-1 branch and directly start a new branch 6.x-2 with the new UI. This depends of the answers I get.
Comment #9
MasterChief CreditAttribution: MasterChief commentedI saw that the other module didn't have any update since the first day of creation which was the 4th april 2009, i think it's better to doesn't wait anything :)
Comment #10
gagarine CreditAttribution: gagarine commentedThis commit http://drupal.org/cvs?commit=470214 should correct the problem. I still don't get why DST need to be stored in database but at least it works.
You can try the 6.x-1.x-dev (after it's rebuild). Or just patch http://drupalcode.org/viewvc/drupal/contributions/modules/node_repeat/no...
I will release a soon as peoples test it and confirm here than nothing is broken.
Comment #11
cwgriesel CreditAttribution: cwgriesel commentedNode Repeat 6.x-1.x-dev fixes the DST problem, but now the advanced repeat features don't work. Choosing "Second Friday" creates a node for *every* friday in the range, not just second fridays.
Comment #12
gagarine CreditAttribution: gagarine commentedThanks a lot for your review. I think I know what is the problem... I will take a look asap.
Comment #13
MasterChief CreditAttribution: MasterChief commentedI confirm that the dst problem isn't a problem anymore :)
Comment #14
gagarine CreditAttribution: gagarine commentedI just started a new branch where I'm going to solve that and other issues. This branch has a different approach and use the insert form.
This branch is not ready for testing...
Comment #15
MasterChief CreditAttribution: MasterChief commentedOk gargarine, so i will wait to test the new branch !
Comment #16
atolborg CreditAttribution: atolborg commentedI am a bit confused. Which version should I install (test), and which module is 'stable' ?
Comment #17
MasterChief CreditAttribution: MasterChief commentedHi atolborg!
You must use 6.x-1.x-dev to have a stable version.
6.x-2.x-dev is for new features but even for only test, you shouldn't install it for now.
I hope it will help you :)
Comment #18
gagarine CreditAttribution: gagarine commentedI made a 6.x-2.0-alpha1 release. It's a complete rewrite . I didn't test it deeply and they are still some stuff to do but I hop it works with DST and advanced repeat feature.
Please try it but read the release note for know issues. Don't hesitate to report every other issue and suggestion (but please open new one).
Comment #19
atolborg CreditAttribution: atolborg commentedThanks alot gagarine. I will test it right away.
Please keep perfecting the module, since it has great potential.
Thanks.
Comment #20
MacaroniDuck CreditAttribution: MacaroniDuck commentedThis is huge gagarine and will benefit a LOT of people. A couple of us have even been lobbying to get this included in the release of Drupal Commons. It's a great installation package, but useless to a lot of social networking groups without the ability to properly create repeating events.
Once you're a touch farther along in testing, I'll be able to jump in and do some testing myself.
Comment #21
MacaroniDuck CreditAttribution: MacaroniDuck commentedI noticed after this was released that several posts appeared making it seem that that alpha came with a new host of issues. Because of that, I've continued using the old version with the DST issue, waiting to hear word on the new issues. Since then, I've not seen much activity for this mod. Is there an update? Is the DST issue truly fixed? Are the other issues being addressed?
I may have some time in the not too distant future to do some testing of this myself, but would love to hear an update first.
Comment #22
cwgriesel CreditAttribution: cwgriesel commentedMy experience is that DST issue is fixed in 6.x-2.0-alpha1, but now node repeats aren't creating separate, individual nodes for each instance of the repeat sequence. Node repeats work if I keep all dates in one node, but choosing to create a new node for each date doesn't work.
Anyone else notice the same behavior?
Comment #23
MacaroniDuck CreditAttribution: MacaroniDuck commentedThat alpha works fine for me creating individual nodes but has several other issues that make it unusable.
Comment #24
MasterChief CreditAttribution: MasterChief commentedI hope gagarine will come soon, we can't use the module with the errors actually.
Comment #25
gagarine CreditAttribution: gagarine commentedIf someone can try DST with the 6.x-3.x it will be great. Please try on a test website with a clean installation.
Comment #26
keith.aumiller CreditAttribution: keith.aumiller commentedI checked this on a fairly new website, (not completely clean) and still saw the issue.
Comment #27
lightsurge CreditAttribution: lightsurge commentedI just tested this and it seems to work fine... so long as I'm testing this right.
My timezone is set as GMT (which changes to BST for summertime) created a year's worth of node repeat nodes, and they all showed a consistent time.
Comment #28
keith.aumiller CreditAttribution: keith.aumiller commentedI'll update and let you know.