Answers.Body: <p>You could replace line 525 with <code>return $locale ? str_replace('-', '_', $locale) : NULL;</code></p>
  <p>I don't know enough about joomla to tell you why it can't determine your language. Possibly this is normal if it has no default, or maybe it is not set in your joomla site/user settings.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-02T20:40:26.897Z
Answers.Text: Thanks for your feedback. I'll doublecheck that language is defined.
Answers.UserDisplayName: Christophe M.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-02T18:29:21.553Z
Answers.LastActivityDate: 2024-01-02T18:29:21.553Z
Answers.UserDisplayName: Demerit
Body: <p>I'm curing a Joomla instance CiviCRM. Just updated from Joomla 3 to joomla 4.4.1 with CiviCRM 5.68.1. <br />
  Updated too the server debian version from 11 to 12. <br />
  configured cron task with cv version v0.3.48</p>
  <p><code>/opt/cv api job.execute --user=XXXX --quiet --cwd=/var/www/html/XXXX/htdocs</code></p>
  <p>Got this message :</p>
  <blockquote>
  <p>[PHP Deprecation] str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated at /var/www/html/XXXX/htdocs/administrator/components/com_civicrm/civicrm/CRM/Utils/System/Joomla.php:525</p>
  </blockquote>
  <p>How can I get rid of this error ?</p>
  
Tags: <php><cron-job><deprecated>
Title: cron job with error php deprecation - str_replace(): Passing null to parameter
ThreadText: # cron job with error php deprecation - str_replace(): Passing null to parameter
  
  (Asked by: username_0 on 2024-01-02)
  
  I'm curing a Joomla instance CiviCRM. Just updated from Joomla 3 to joomla 4.4.1 with CiviCRM 5.68.1.   
  Updated too the server debian version from 11 to 12.   
  configured cron task with cv version v0.3.48
  
  `/opt/cv api job.execute --user=XXXX --quiet --cwd=/var/www/html/XXXX/htdocs`
  
  Got this message :
  
  > [PHP Deprecation] str\_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated at /var/www/html/XXXX/htdocs/administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php:525
  
  How can I get rid of this error ?
  
  **Tags:** php, cron-job, deprecated
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-01-02. Score: 0
  
  You could replace line 525 with `return $locale ? str_replace('-', '_', $locale) : NULL;`
  
  I don't know enough about joomla to tell you why it can't determine your language. Possibly this is normal if it has no default, or maybe it is not set in your joomla site/user settings.
  
  > **Comments:**
  > **username_0**: Thanks for your feedback. I'll doublecheck that language is defined.  
  
  ---
  
  