2

My log is largely full of various warnings about deprecated function calls, from both CiviCRM core and extensions. They do not seem to cause direct problems, but finding genuine problem messages among all the noise is difficult, and there is a worry that the support for the deprecated version will be withdrawn before the calling code is fixed.

I have raised a PR on GitHub with a fix for one simple case (so far without response), but in general I don't know enough about the problem to be confident trying to alter the code correctly.

4
0

All you can really do is log an issue or PR. You're right they don't hurt anything but yes they'll need to be fixed by the extension/core eventually.

If you want to turn them off temporarily you can hack CRM/Core/Error/Log.php to just return instead of logging them, but of course they'll come back when you upgrade if they aren't fixed yet.

I'll note though that the logging is also there in the situation where it was marked deprecated but it's not known fully if anyone has a configuration where it's used, and so the hope is they'll report it.

1
  • maybe this could be a civi-lite thread to do-ocracy week (assuming these are dev-lite type tasks - and hence only a few metres over my head)
    – petednz - fuzion
    Oct 11 '20 at 22:00
0

Note: this answer is wrong, as @demerit correctly points out in his polite comment. I've added a followup below.

[wrong!]

Deprecated notices are logged only if CiviCRM thinks you're running a development environment. Unfortunately, CiviCRM's test for that isn't very smart, and in particular, if you've pulled your CiviCRM code from a git repo, it thinks you're running a development environment.

Try removing or temporarily renaming that .git directory.

I can't remember where or when this was noted previously, that test does need to be improved.

I agree that they're not useful notices when running a production environment, they're really designed for automated testing only.

[/wrong]

It would be nice to not log deprecation notices on a production site. At the moment I think you'd have to do that by editing /CRM/Core/Error/Log.php at our about line 57.

2
  • 1
    I think you're thinking of this one: github.com/civicrm/civicrm-core/pull/17276. But I think it still logs them in ConfigAndLog in production, it just doesn't call trigger_error() in production.
    – Demerit
    Oct 14 '20 at 17:01
  • We are getting them logged in our production system. The only Git involved is on a couple of custom Modules/Extensions which are not where the errors are coming from. We also get PHP Notices such as "Notice: Trying to get property 'total_amount' of non-object in CRM_Contribute_BAO_Contribution::checkTaxAmount() (line 4180 of /home/lalg/www/www/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php)" and also Warnings, generated from CiviCRM or Extensions. Oct 15 '20 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.