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.
Follow-up to #2429443: Date format form is unusable
Problem/Motivation
When trying to format a timestamp with timezone details, there is a unnecessary call to drupal_get_user_timezone().
Proposed resolution
Make drupal_get_user_timezone() only when necessary.
Remaining tasks
1. Patch
2. Test
User interface changes
N/A
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2457251-unneccessary-timezone-call-3.patch | 789 bytes | vijaycs85 |
Comments
Comment #1
vijaycs85Initial patch...
Comment #2
vijaycs85Comment #3
vijaycs85Much cleaner, as per @alexpott suggestion.
Comment #7
dawehnerThis looks great!
Comment #8
alexpottWhat test is this functionality covered by?
Comment #9
tim.plunkett\Drupal\system\Tests\Datetime\DrupalDateTimeTest has
Locally I commented out this bit and that assertion failed:
I would consider that sufficient, I don't think this optimization needs a whole unit test to back it.
Comment #10
alexpott@tim.plunkett yep thanks for the sleuthing I just wanted to be sure it was covered - thanks!
This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 47e418f and pushed to 8.0.x. Thanks!
Comment #12
vijaycs85Yay! Thanks @alexpott and @tim.plunkett