*

bgd

  • ***
  • 33 posts
PHP Fatal error
« on: February 10, 2023, 03:09:20 PM »
I receive each day this fatal error:

`PHP message: PHP Fatal error:  Uncaught TypeError: current(): Argument #1 ($array) must be of type array, null given in ...public_html/oc-includes/osclass/emails.php:1482`


the line 1482 is

Code: [Select]
$content = current($aPage['locale']);


Any suggestions? thank you
« Last Edit: February 10, 2023, 03:54:25 PM by bgd »

*

MB Themes

Re: PHP Fatal error
« Reply #1 on: February 10, 2023, 04:22:33 PM »
Check on your database in t_pages and pages_description if all is ok here and all email templates exists.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

bgd

  • ***
  • 33 posts
Re: PHP Fatal error
« Reply #2 on: February 10, 2023, 05:15:25 PM »
thank you.

I found a difference in email templates between my old database and a new fresh install database.

For template   - fresh install       {WEB_TITLE} - Your ad is about to expire  -   internal name is   email_warn_expiration

                     - old database      {WEB_TITLE} - Your ad is about to expire  -    internal name is    email_ad_expire


could this be a problem?


this is the complet error:

*[Fri Feb 10 16:00:02.199905 2023] [proxy_fcgi:error] [pid 340351:tid 140564666242624] [client 111.30.60.91:0] AH01071: Got error 'PHP message: PHP Warning:  Undefined array key "locale" in /public_html/oc-includes/osclass/emails.php on line 1482PHP message: PHP Fatal error:  Uncaught TypeError: current(): Argument #1 ($array) must be of type array, null given in public_html/oc-includes/osclass/emails.php:1482\nStack trace:\n#0 /public_html/oc-includes/osclass/emails.php(1482): current()\n#1 /public_html/oc-includes/osclass/classes/Plugins.php(42): fn_email_warn_expiration()\n#2 public_html/oc-includes/osclass/helpers/hPlugins.php(34): Plugins::runHook()\n#3 /public_html/oc-includes/osclass/cron.php(72): osc_run_hook()\n#4 /public_html/index.php(206): require_once('...')\n#5 {main}\n  thrown in public_html/oc-includes/osclass/emails.php on line 1482'*

*

MB Themes

Re: PHP Fatal error
« Reply #3 on: February 10, 2023, 08:10:07 PM »
It simply means that email template does not exists
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

bgd

  • ***
  • 33 posts
Re: PHP Fatal error
« Reply #4 on: February 10, 2023, 08:24:21 PM »
thank you.

I inserted this in database:

Code: [Select]
INSERT INTO /*TABLE_PREFIX*/t_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (22, 'ro_RO', '{WEB_TITLE} - Anunţul tău va expira în curând', '<p>Salutare {USER_NAME},</p><p>Anunţul tău <a href="{ITEM_URL}">{ITEM_TITLE}</a> de pe {WEB_LINK} va expira în curând.');
« Last Edit: February 10, 2023, 08:27:14 PM by bgd »