-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Referencer/Dereferencer logger error #4217
Conversation
I tried applying the patch from this to 2.18.3 and would not apply. I'll try a more up-to-date install. |
*/ | ||
private function htmlPurifier(string $input) { | ||
// Initialize HTML Purifier cache config settings array. | ||
$config = []; | ||
|
||
// Determine path to tmp directory. | ||
// @todo Inject this service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean this as a reminder to yourself for this ticket or for future selves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our future selves. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #4207
Originally, this was reported against
Referencer
andDereferencer
, but it's not just those.#4140 broke a bunch of logging functionality, so we fix it here.
Explicitly adds
colinodell/psr-testlogger
to our dev dependencies, but it's already a dependency ofdrupal/core-dev
: https://git.drupalcode.org/project/drupal/-/blob/10.1.x/composer.json?ref_type=heads#L21All the classes that use logging incorrectly:
modules/datastore/src/Storage/DatabaseTable.php
modules/metastore/src/MetastoreService.php
modules/metastore/src/Reference/Dereferencer.php
modules/metastore/src/Reference/Referencer.php
modules/metastore/src/Storage/Data.php
modules/metastore/src/Storage/ResourceMapperDatabaseTable.php
All these classes now call their logger as if it were a
\Psr\Log\LoggerInterface
(because it is).All these classes now have tests which touch the logging call, except
ResourceMapperDatabaseTable
, which is deprecated (but still fixed).Another notable exception is
Referencer::referenceSingle()
, where the logging code seems to be unreachable by test. One wonders if it counts as dead code.QA steps include:
ResourceMapperDatabaseTable
, which we didn't add tests for because it's deprecated.