- 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
The issue this was postponed on was committed in Drupal 9.3.x.
- Status changed to Needs work
over 1 year ago 2:45am 19 April 2023 - 🇫🇷France andypost
+++ b/core/modules/system/system.module @@ -1169,30 +1169,20 @@ function system_time_zones($blank = NULL, $grouped = FALSE) { + * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use ... + @trigger_error(__FUNCTION__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\File\FileFetcherInterface::fetch() instead. See https://www.drupal.org/node/3223362', E_USER_DEPRECATED); +++ b/core/modules/system/tests/src/Kernel/SystemDeprecationTest.php @@ -0,0 +1,42 @@ + $this->expectDeprecation('system_retrieve_file is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\File\FileFetcherInterface::fetch() instead. See https://www.drupal.org/node/3223362');
needs re-roll
- Status changed to Needs review
over 1 year ago 3:51am 19 April 2023 - last update
over 1 year ago Custom Commands Failed - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
As mentioned in #16 I think we should deprecate without replacement.
I can only see 2 places in core where this gets used, and both of them just need to use the unmanaged file system to write the file.
- last update
over 1 year ago 29,283 pass, 1 fail - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Format deprecation message correctly.
The last submitted patch, 23: 3223205-23.patch, failed testing. View results →
- last update
over 1 year ago 29,284 pass - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
locale_translation_download_source
expects the file to be saved with the same name as the fetched URL file. - 🇨🇭Switzerland berdir Switzerland
Do we need to take care of error handling in these replacements? system_retrieve_file() converted any exceptions to messages.
- 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
There is 📌 Change system_retrieve_file function to return error instead of generating Drupal messages Closed: outdated linked in the IS. Do we want to document them, and just let the exceptions bubble up? Personally, I think it's strange to set messages at this level.
- 🇨🇭Switzerland berdir Switzerland
Sure, just messages is strange, but not catching them means we'll break update and translation import processes, I've definitely seen error messages around translation imports in the past. As an Api function, adding messages was weird, but in this specific cases, that might be fine?
- 🇨🇭Switzerland berdir Switzerland
And 📌 Change system_retrieve_file function to return error instead of generating Drupal messages Closed: outdated will be a won't fix once the function is deprecated but would result in exactly the same as we have to do here. Returning an error means callers need to make the decision on how to handle the error, just like here.
- 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
> Returning an error means callers need to make the decision on how to handle the error, just like here.
But it should be handled further up that call stack. That's where you can potentially do something more useful with more context.
- last update
over 1 year ago 29,284 pass - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Copied over setting messages if exceptions are caught in the two locations where this function has been replaced.
Updated the title and IS to reflect the current solution.
- Status changed to Needs work
over 1 year ago 8:14pm 6 May 2023 - 🇺🇸United States smustgrave
Can we add test coverage for the new errors being logged here?
+ catch (TransferException $exception) { + \Drupal::messenger()->addError(t('Failed to fetch file due to error "%error"', ['%error' => $exception->getMessage()])); + } + catch (FileException | InvalidStreamWrapperException $e) { + \Drupal::messenger()->addError(t('Failed to save file due to error "%error"', ['%error' => $e->getMessage()])); + }
- Status changed to Needs review
over 1 year ago 10:25pm 7 May 2023 - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
These are not new errors being logged. We're copying the behaviour of
system_retrieve_file()
which is now deprecated. - Status changed to RTBC
over 1 year ago 1:13pm 8 May 2023 - last update
over 1 year ago 29,381 pass - last update
over 1 year ago 29,382 pass - last update
over 1 year ago 29,389 pass - Open on Drupal.org →Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass 35:18 30:34 RunningThe last submitted patch, 31: 3223205-31.patch, failed testing. View results →
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Are we sure the test fail here is random .. its to do with a locale file it seems?
- last update
over 1 year ago 29,389 pass - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - 🇦🇺Australia kim.pepper 🏄♂️🇦🇺Sydney, Australia
Rebase on 11.x and updated deprecation message with 10.2.0 version.
- 🇨🇦Canada jibran Toronto, Canada
I reviewed the patch with @kim.pepper at DrupalSouth the changes look good so setting it back to RTBC.
35:18 31:24 Running- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - Status changed to Needs review
over 1 year ago 9:47am 29 May 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
No longer applies, can we get a reroll please 🙏
- Status changed to RTBC
over 1 year ago 2:37pm 29 May 2023 23:07 20:36 Running- last update
over 1 year ago 29,403 pass - last update
over 1 year ago 29,412 pass - last update
over 1 year ago 29,412 pass - last update
over 1 year ago Build Successful - last update
over 1 year ago 29,437 pass - last update
over 1 year ago 29,438 pass - last update
over 1 year ago 29,444 pass - last update
over 1 year ago 29,449 pass - last update
over 1 year ago 29,487 pass - last update
over 1 year ago 29,500 pass - last update
over 1 year ago 29,506 pass -
larowlan →
committed 8219cb1f on 11.x
Issue #3223205 by kim.pepper, smustgrave, hmendes, anweshasinha, Berdir...
-
larowlan →
committed 8219cb1f on 11.x
- Status changed to Fixed
over 1 year ago 12:29am 23 June 2023 Automatically closed - issue fixed for 2 weeks with no activity.