*

mwindey

  • *****
  • 478 posts
Apache warning undefined array key in php 8.1
« on: November 21, 2023, 10:22:43 PM »
Message in Apache log on line 153 where the language file is not found or null even though it is present.
What can be the cause here?
Line 153 is:
Code: [Select]
<?php echo $user['locale'][osc_current_user_locale()]['s_info']; ?>

Thanks....

[Tue Nov 21 21:46:27.794919 2023] [lsapi:warn] [pid 112547:tid 140716374042368] [client 2a02:1811:b055:6200:599d:6139:15ad:97f7:60649] [host ***.be] Backend log: PHP Warning:  Undefined array key "nl_NL" in /home/u44173p13***/domains/***.be/public_html/oc-content/plugins/backoffice_manager/form/form_feedback_add.php on line 153\n, referer: https://***.be/

[Tue Nov 21 21:46:27.794963 2023] [lsapi:warn] [pid 112547:tid 140716374042368] [client 2a02:1811:b055:6200:599d:6139:15ad:97f7:60649] [host ***.be] Backend log: PHP Warning:  Trying to access array offset on value of type null in /home/u44173p13***/domains/**.be/public_html/oc-content/plugins/backoffice_manager/form/form_feedback_add.php on line 153\n, referer: https://***.be/
« Last Edit: November 21, 2023, 10:25:18 PM by mwindey »

Marked as best answer by mwindey on November 22, 2023, 10:20:14 AM
*

MB Themes

Re: Apache warning undefined array key in php 8.1
« Reply #1 on: November 22, 2023, 09:35:26 AM »
Change it to:
Code: [Select]
<?php echo @$user['locale'][osc_current_user_locale()]['s_info']; ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mwindey

  • *****
  • 478 posts
Re: Apache warning undefined array key in php 8.1
« Reply #2 on: November 22, 2023, 10:20:35 AM »
 8) Thank you