Implement drupal_get_user_timezone() #15794
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before
Contributions made by anonymous user were recorded in CiviCRM using timezone set on server level.
Drupal8.php is the only file in /var/www/drupal/vendor/civicrm/civicrm-core/CRM/Utils/System without a
public function getTimeZoneString()
After
After implementing drupal_get_user_timezone() -> Contributions made by anonymous users are now recorded in the Default timezone configured within Drupal8:
/admin/config/regional/settings
For testing I added a drupal_set_message(print_r($timezone, TRUE)) in Drupal8.php -> it shows it's correctly finding America/Edmonton.
Technical Details
Similar to the D7 implementation - except simpler. Too simple actually - I could well be missing something though I did some more testing and this seems to work.
Todo: more Testing -> done: