Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Relates to the implemented fix in https://www.drupal.org/node/1896264: this fix added the default timezone of UTC when calculating the date fields. This means that the date calculation is still incorrect when timezones other than UTC have been used to collect the dates.
This was seen on a site using the default London/Europe timezone and advpolls: polls were reporting as closed for an hour longer than they should during BST as the open/closed dates were being processed as UTC, not the timezone stored in the field.
Comment | File | Size | Author |
---|---|---|---|
#19 | poll_availability_date-2709169-19.patch | 4.36 KB | tripper54 |
#14 | poll_availability_date-2709169-14.patch | 4.59 KB | tripper54 |
#6 | poll_availability_date-2709169-6.patch | 4.59 KB | tripper54 |
#2 | 2709169-poll_availability_date_utc-2.patch | 4.45 KB | MrDaleSmith |
|
Comments
Comment #2
MrDaleSmith CreditAttribution: MrDaleSmith at CTI Digital commentedCreated a patch that adds a custom helper to pull date data from the advpoll node taking account of any timezone stored in the field data.
Code uses a entity_metadata_wrapper to obtain language agnostic values from the node, which means a dependency on entity has to be added to the module. If this is acceptable, it may be worth updating all the code to use entity_metadata_wrappers instead of the current language workarounds.
Comment #3
MrDaleSmith CreditAttribution: MrDaleSmith at CTI Digital commentedComment #5
MrDaleSmith CreditAttribution: MrDaleSmith at CTI Digital commentedI don't think that fail is anything to do with the patch, although I'd be happy to rework if it turns out it is?
Comment #6
tripper54 CreditAttribution: tripper54 commentedYar, weird, the tests run OK for me locally.
It might have been an issue with a dependant module as the tests failed to enable the required modules.
I re-rolled with the addition of your added entity api dependency in the test setup method.
We'll see how that goes.
Comment #7
tripper54 CreditAttribution: tripper54 commentedComment #12
wylbur CreditAttribution: wylbur as a volunteer commentedUsing
Drupal 7.43
PHP 5.5.9
MySQL 5.5.49
Advanced Poll
Version : 7.x-3.0-alpha1+6-dev
Date : 2016-04-20
Applied patch successfully from the root of the Advanced Poll module directory.
When we schedule an opening date, the date/time was offest by the difference of our time zone to UTC. After patching module, the open date now matches displayed open date.
Did NOT mark this as RTBC, but I consider this review and tested.
Comment #13
tripper54 CreditAttribution: tripper54 commentedtrying these tests again.
Comment #14
tripper54 CreditAttribution: tripper54 commentedComment #19
tripper54 CreditAttribution: tripper54 commented