Problem/Motivation
DateFormatter has a method to get the default country and pass it into a DrupalDateTime object:
// Create a DrupalDateTime object from the timestamp and timezone.
$create_settings = [
'langcode' => $langcode,
'country' => $this->country(),
];
$date = DrupalDateTime::createFromTimestamp($timestamp, $this->timezones[$timezone], $create_settings);
Since #2276183: Date intl support is broken, remove it DrupalDateTime has not done anything with this information.
Steps to reproduce
N/A
Proposed resolution
Remove the call to country.
Deprecate the country() method.
Remaining tasks
I do not believe this deprecation requires a unit test: getSerializer does not have one and is similarly a protected static method.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
Issue fork drupal-3439440
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3439440-remove-country-support
changes, plain diff MR !7369
Comments
Comment #3
nicxvan commentedAdding related issue 3439439
Comment #4
andypostLooks having a deprecation message for 10.3 is useful here
Comment #5
nicxvan commentedI added a deprecated tag, I'm not sure if 10.3 is correct.
I'm also unclear if I need to do anything for:
and
Comment #7
nicxvan commentedOh, I should have refreshed, it looks like andypost confirmed that 10.3 is correct, I'm not sure about the property though, I read through this:
https://www.drupal.org/about/core/policies/core-change-policies/drupal-d...
Comment #8
nicxvan commentedOk I fixed the deprecation notice and added the trigger warning.
I removed the call to country in order to get past the phpstan for now.
I think the call to the method can be removed since it's not used, but I'm not entirely sure.
I'll add the deprecated unit test shortly.
Comment #9
nicxvan commentedActually I'm not sure this needs a test for deprecation since it's a protected function only called in this class. I found another example of a protected method and there are no deprecation tests for that:
https://git.drupalcode.org/project/drupal/-/merge_requests/6224/diffs#2d...
getSerializer
Let me know if that is incorrect.
Comment #10
nicxvan commentedComment #12
nicxvan commentedComment #13
nicxvan commentedComment #14
nicxvan commentedComment #15
nicxvan commentedComment #16
smustgrave commentedDeprecation seems straight forward. Wonder once this is merged if the ticket should just be kept open for the removal in 11.x. But lets get the deprecation merged first.
Comment #19
catchCommitted/pushed to 11.x and cherry-picked to 10.3.x, thanks!
I think it's easier still to do the removal in another issue (possibly combined with other removals), another option would have been separate 11.x and 10.3.x MRs here, but both need to be reviewed and RTBCed together if so.
Comment #20
nicxvan commentedI'll create the followup thanks!