Answers.Body: <p>I ran into this as well. I think it's similar to the issue in this PR: <a href="https://github.com/civicrm/civicrm-core/pull/25728" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/25728</a></p>
  <p>But that one addressed the issue in D8, whereas the issue persists in D7.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-25T12:51:33.433Z
Answers.Text: we fixed this by making sure our standalone script called drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL) early in the script. that ensured watchdog was available.
Answers.UserDisplayName: lcdservices
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-25T12:41:46.860Z
Answers.LastActivityDate: 2024-09-25T12:41:46.860Z
Answers.UserDisplayName: lcdservices
Body: <p>After updating a CiviCRM with Drupal 7 system with the <a href="https://civicrm.org/blog/dev-team/civicrm-5650-5644-5634-esr-security-release" rel="nofollow noreferrer">CiviCRM Security Update</a> a PHP script that I wrote throws the following error:</p>
  <pre><code>PHP Fatal error:  Uncaught Error: Call to undefined function watchdog() in xxxxxxx/public/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php:274
  Stack trace:
  #0 xxxxxxx/sites/all/modules/civicrm/CRM/Core/Error.php(607): CRM_Utils_System_DrupalBase-&gt;logger('Contribution 28...', 6)
  #1 xxxxxxx/sites/all/modules/civicrm/CRM/Core/Error/Log.php(69): CRM_Core_Error::debug_log_message('Contribution 28...', false, '', 6)
  #2 xxxxxxx/sites/all/modules/civicrm/vendor/psr/log/Psr/Log/AbstractLogger.php(113): CRM_Core_Error_Log-&gt;log('info', 'Contribution 28...', Array)
  #3 xxxxxxx/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(3880): Psr\Log\AbstractLogger-&gt;info('Contribution 28...')
  #4 xxxxxxx/sites/all/modules/civicrm/api/v3/Contributio in xxxxxxx/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php on line 274
  </code></pre>
  <p>After disabling &quot;Drupal Watchdog Logging&quot; in the GUI (Administration &gt; Debugging and Error handling) the error disappears. This is not really an option though, as we want to keep the Drupal Error Logging for the system.</p>
  <p>The script is creating payments via CiviCRM APIv3 based on bank reports. The error seems pretty &quot;basic&quot; though, and not related much to the script's functions. The script is run daily by a cronjob.</p>
  <p>I updated CiviCRM again to 5.65.1 but this didn't fix the problem.</p>
  <p>Anybody has a hint what could be wrong here?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-25T15:50:49.970Z
Comments.Text: What tool are you using to run the script?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-27T11:42:51.417Z
Comments.Text: It's a PHP script that is run daily by a cronjob. I edited my question
Comments.UserDisplayName: emma
Tags: <drupal><upgrade><contributions><payment>
Title: After CiviCRM Security Update, "Call to undefined function watchdog()"
ThreadText: # After CiviCRM Security Update, "Call to undefined function watchdog()"
  
  (Asked by: username_0 on 2023-09-25)
  
  After updating a CiviCRM with Drupal 7 system with the CiviCRM Security Update a PHP script that I wrote throws the following error:
  PHP Fatal error:  Uncaught Error: Call to undefined function watchdog() in xxxxxxx/public/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php:274
  Stack trace:
  #0 xxxxxxx/sites/all/modules/civicrm/CRM/Core/Error.php(607): CRM_Utils_System_DrupalBase->logger('Contribution 28...', 6)
  #1 xxxxxxx/sites/all/modules/civicrm/CRM/Core/Error/Log.php(69): CRM_Core_Error::debug_log_message('Contribution 28...', false, '', 6)
  #2 xxxxxxx/sites/all/modules/civicrm/vendor/psr/log/Psr/Log/AbstractLogger.php(113): CRM_Core_Error_Log->log('info', 'Contribution 28...', Array)
  #3 xxxxxxx/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(3880): Psr\Log\AbstractLogger->info('Contribution 28...')
  #4 xxxxxxx/sites/all/modules/civicrm/api/v3/Contributio in xxxxxxx/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php on line 274
  
  After disabling "Drupal Watchdog Logging" in the GUI (Administration > Debugging and Error handling) the error disappears. This is not really an option though, as we want to keep the Drupal Error Logging for the system.
  The script is creating payments via CiviCRM APIv3 based on bank reports. The error seems pretty "basic" though, and not related much to the script's functions. The script is run daily by a cronjob.
  I updated CiviCRM again to 5.65.1 but this didn't fix the problem.
  Anybody has a hint what could be wrong here?
  
  **Tags:** drupal, upgrade, contributions, payment
  
  > **Comments:**
  > **username_1**: What tool are you using to run the script?  
  > **username_0**: It's a PHP script that is run daily by a cronjob. I edited my question  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-09-25. Score: 1
  
  I ran into this as well. I think it's similar to the issue in this PR: <https://github.com/civicrm/civicrm-core/pull/25728>
  
  But that one addressed the issue in D8, whereas the issue persists in D7.
  
  > **Comments:**
  > **username_2**: we fixed this by making sure our standalone script called drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL) early in the script. that ensured watchdog was available.  
  
  ---
  
  