The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- last update
over 1 year ago Patch Failed to Apply - π·πΊRussia Chi
Inside of Drupal\Core\File\FileSystem class, instance of logger is used only once in the chmod() method to log error when chmod() PHP function returns FALSE.
The issues is quite old. At the moment, file system makes a heavy use of the logger.
- First commit to issue fork.
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,814 pass - Status changed to Needs review
over 1 year ago 5:07pm 14 July 2023 - Status changed to Needs work
over 1 year ago 4:54am 17 July 2023 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
NW for MR feedback above.
- π¬π§United Kingdom alexpott πͺπΊπ
I think given that we have code like
if (is_dir($directory) && !is_writable($directory) && !$file_system->chmod($directory)) {
we should go for solution 2 as the less disruptive for now. And leave it up to the calling code to log if necessary. In the above example, logging is actually not appropriate as this is used to inform the user.
- π¬π§United Kingdom alexpott πͺπΊπ
Hiding patches as we have an MR now.
- Status changed to Needs review
11 months ago 12:22pm 22 January 2024 - π¬π§United Kingdom alexpott πͺπΊπ
Updated issue summary with latest changes.
- πΊπΈUnited States mfb San Francisco
I updated the change record to more completely describe the impacts of logging being removed. Now I realize it needs a bit more work as I see Alexpott added an additional new change record, so they are partially redundant.
- π¬π§United Kingdom longwave UK
Why do we need the $throw argument, the caller can detect failure via the return value already?
- π¬π§United Kingdom alexpott πͺπΊπ
@longwave yeah I went that way originally but then got cold feet when deleting the exception.. but I agree - let's remove $throw.
- π¬π§United Kingdom longwave UK
If we think it's worth cleaning up, perhaps in a followup we can add deprecations in all the cases we currently return FALSE and notify users that we will start throwing exceptions instead in the next major.
- π¬π§United Kingdom alexpott πͺπΊπ
@longwave I don't think we want that though - in the case of chod there are times that throwing an exception would lead to way more complex calling code.
- πΊπΈUnited States mfb San Francisco
@alexpott I'd say it should still be mentioned in the change record that logging is removed from those other methods, not just chmod. But you removed my mention of those. This is relevant if the calling code caught the exception and assumed an error was already logged by the file_system service.
- π¬π§United Kingdom alexpott πͺπΊπ
@mfb I've listed the public method that no longer log in the CR and detailed that it is the callers responsibility to log if any method results in FALSE or throws an exception.
- Status changed to Needs work
11 months ago 1:58am 23 January 2024 - Status changed to Needs review
11 months ago 11:36am 24 January 2024 - π¬π§United Kingdom longwave UK
Fixed deprecation, also fixed a nit in the docblock.
π Inject services into LoggerChannelFactory RTBC is somewhat related, there is special code in LoggerChannelFactory to handle the case where the injected dependencies are not present (during the installer), once this dependency is gone I think that can also be removed.
- π³π±Netherlands spokje
Tagging with
Needs followup
for #52 π Remove dependency of "file_system" service on "logger" Needs work - Status changed to RTBC
11 months ago 12:26pm 24 January 2024 - π³π±Netherlands spokje
Code changes make sense and are primarily removing logging/loggers and altering comments about logging/loggers.
Checked CR and that mentions all methods involved in not being logged any more.
Tests are green.For me this is RTBC.
- π¬π§United Kingdom longwave UK
The followup isn't really needed until both issues land, just they overlap a bit, so we can probably fix it directly in whichever lands second - removing the tag.
- π³π±Netherlands spokje
I'm glad somebody is an optimist and is sure we'll remember ;)
- π¬π§United Kingdom longwave UK
Well it's only a bit of dead code if we don't. And π Fix install container definition of StreamWrapperManager Needs review is making me think that this might not even get used...
- πΊπΈUnited States SocialNicheGuru
I applied this π Remove dependency of "file_system" service on "logger" Needs work I get this:
Circular reference detected for service "workspaces.manager", path: "scheduler.manager -> dat
e.formatter -> workspaces.manager -> logger.channel.workspaces -> logger.factory -> logger.syslog". - π³π±Netherlands spokje
#58: You might have c/p a wrong issue link (it is to this very issue) in there?
- π¬π§United Kingdom alexpott πͺπΊπ
@SocialNicheGuru we're going to need some more information about how to reproduce what you are seeing. I have installed:
- Standard profile
- Enabled scheduler, workspaces, filecache
- Configured filecache
- Enabled syslog
- Boom things are broken
- Applied this MR and cleared the cached - things are fixed
I can create the datetime.formatter and workspaces.manager services just fine after this. But my datetime.formatter does not depend on workspaces.manager - how is that happening on your install?
This MR is definitely resolving a bug.
- Status changed to Needs work
10 months ago 12:25pm 12 February 2024 - Status changed to Needs review
10 months ago 3:50am 26 February 2024 - Status changed to RTBC
10 months ago 7:59am 26 February 2024 - π¬π§United Kingdom alexpott πͺπΊπ
@catch's feedback has been addressed. This looks good to go now. Thanks @kim.pepper.
- π¬π§United Kingdom catch
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
- Status changed to Fixed
10 months ago 10:41am 26 February 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- πΊπΈUnited States mfb San Francisco
By the way, I noticed that at least one contrib file system decorator (s3fs) still has a dependency on logger. And logging seems even more useful/necessary for s3fs than the default local file_system (all kinds of API errors, network errors, etc.). So I still see some utility in the alternative work-around of a lazy config service that loggers could depend on ( π Dependency on config storage causes circular reference in service container Needs review )