-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Update pear/log to 1.14.4 #30484
Update pear/log to 1.14.4 #30484
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
bb8dbd2
to
5da39e7
Compare
Test fails are in Using strftime-style formatting is deprecated' contains "Error in call to Pledge_get : API permission check failed for Pledge/get call; insufficient permission: require access CiviCRM and access CiviPledge". - presumably that was in our patch that I didn't apply |
@eileenmcnaughton can you remove the changes to composer.lock and re-run your composer update doing |
fcfa99e
to
ae9d03d
Compare
We are already checking the file name indirectly - by loading the file
@seamuslee001 @demeritcowboy this is passing now - but I have not unravelled the details of the patch that I have stopped applying. At a high level I think this was the intent of the discussion from the PR #29235 which I have tried to rescue here - ie I think the patches were compatibility patches & that @demeritcowboy had done enough of a job upstreaming that we no longer need them |
They were mostly about keeping things that already exist elsewhere working I think. For example the call to setLocale doesn't mean anything for ISO format, but is needed if you create a log with a locale-dependent format string. I'm not sure off the top of my head which other library packages use pear/log, or if core is the only one. composer might know... |
composer.lock suggests this is the only use of it, and a universe search for a few variations doesn't show much. So I think this just needs a run with some cmses. And I don't trust the tests fully for composer.json changes because there are some things that happen before the PR is applied where it's still using the old version. |
@@ -106,8 +106,7 @@ public function testDebugLoggerFormat(): void { | |||
$log->log('Mary had a little lamb'); | |||
$log->log('Little lamb'); | |||
$config = CRM_Core_Config::singleton(); | |||
$fileContents = file_get_contents($log->_filename); | |||
$this->assertEquals($config->configAndLogDir . 'CiviCRM.' . CIVICRM_DOMAIN_ID . '.' . 'my-test.' . CRM_Core_Error::generateLogFileHash($config) . '.log', $log->_filename); | |||
$fileContents = file_get_contents($config->configAndLogDir . 'CiviCRM.' . CIVICRM_DOMAIN_ID . '.' . 'my-test.' . CRM_Core_Error::generateLogFileHash($config) . '.log'); |
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.
I can see they've prevented getting the log file name now, just it means two things:
- The update to 1.14 will break the logviewer extension. FYI @adixon
- While maybe not the most important thing in the world, the naming of the file was a relevant thing to test. And especially now if we have to know how it's constructed in order to find it, then that structure should be enforced by a test.
Does our function CRM_Core_Error::generateLogFileName() need to be protected? Could we expose that? The hash function is already public. The Civi::static is public but people shouldn't rely on that.
Some more info about the patch. Short version is I don't see a need for it, and so also a followup could remove the references to setLocale().
So,
|
Thanks for all your digging @demeritcowboy - I don't really have my head around it all - I was mostly just trying to get the stalled PR over the line since it seemed really close (it was the first 90% there - leaving the last 10% that takes the other 90% of the time) |
Ok thanks. I'll just run one more test and then I'd say we can merge this and then deal with the filename problem. |
Nice @demeritcowboy !! |
Overview
Attempt to resurrect #29235
Before
pear version 1.13.3
After
pear 1.14.3
Technical Details
This was attempted on the first PR & some upstream update was done - but this kinda got a bit messed up on the other PR & I think it failed tests so lessee
I removed our patch on this as it created duplicate copies of the functions - but not sure if there is stuff in it that is still needed - will check in with @demeritcowboy once tests pass
UPDATE seeing 2 issues locally
PHP Warning: Using strftime-style formatting is deprecated in /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/vendor/pear/log/Log.php on line 831
PHP Warning: Using strftime-style formatting is deprecated in /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/vendor/pear/log/Log.php on line 831
PHP Warning: Using strftime-style formatting is deprecate
-error
Failure in api call for System check: Undefined property: Log_file::$_filename
#0 /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/CRM/Utils/Check/Component/Security.php(63): PHPUnit\Util\ErrorHandler->__invoke()
#1 /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/CRM/Utils/Check/Component.php(76):
Comments