*

mattlee

  • **
  • 12 posts
Dairy and Yearly Cron not working.
« on: October 13, 2023, 05:06:17 PM »
Hi may I know how to correct Cron job for dairy and yearly?
I check my Cron job from Setting - General. Dairy and yearly incorrect.

*

MB Themes

Re: Dairy and Yearly Cron not working.
« Reply #1 on: October 13, 2023, 05:15:46 PM »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mattlee

  • **
  • 12 posts
Re: Dairy and Yearly Cron not working.
« Reply #2 on: October 13, 2023, 05:28:51 PM »
Hi thank you for your reply.
I already follow the step by step.

All Cron job working well but dairy and year Cron date look so weird.
Yearly should be 2023 and my Cron date "-0000".

May I know how to solve the date??

Kindly refer to attachment file

*

MB Themes

Re: Dairy and Yearly Cron not working.
« Reply #3 on: October 13, 2023, 07:53:13 PM »
It probably means it was never executed.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mattlee

  • **
  • 12 posts
Re: Dairy and Yearly Cron not working.
« Reply #4 on: October 13, 2023, 07:55:48 PM »
May I know how to solve this problem??

*

MB Themes

Re: Dairy and Yearly Cron not working.
« Reply #5 on: October 14, 2023, 08:08:18 AM »
Correctly configure all jobs and enable PHP error logs so in case there is function that is failing, you have that info in logs.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mattlee

  • **
  • 12 posts
Re: Dairy and Yearly Cron not working.
« Reply #6 on: October 15, 2023, 09:09:55 AM »
Hi,
Here is my error log file.

PHP error log:
[15-Oct-2023 00:00:03 America/Los_Angeles] PHP Warning:  Undefined array key "HTTP_HOST" in /home2/mattsco/public_html/kclas/oc-includes/osclass/utils.php on line 100
[15-Oct-2023 00:00:03 America/Los_Angeles] PHP Warning:  Undefined array key "REQUEST_URI" in /home2/mattsco/public_html/kclas/oc-includes/osclass/utils.php on line 100
[15-Oct-2023 00:00:03 America/Los_Angeles] PHP Warning:  Undefined array key "HTTP_HOST" in /home2/mattsco/public_html/kclas/oc-includes/osclass/utils.php on line 100
[15-Oct-2023 00:00:03 America/Los_Angeles] PHP Warning:  Undefined array key "REQUEST_URI" in /home2/mattsco/public_html/kclas/oc-includes/osclass/utils.php on line 100
[15-Oct-2023 00:00:03 America/Los_Angeles] PHP Warning:  Undefined array key "HTTP_HOST" in /home2/mattsco/public_html/kclas/oc-includes/osclass/utils.php on line 100
[15-Oct-2023 00:00:03 America/Los_Angeles] PHP Warning:  Undefined array key "REQUEST_URI" in /home2/mattsco/public_html/kclas/oc-includes/osclass/utils.php on line 100

-----------------------------------------------------------------

utils.php (line 100)
  $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

*

MB Themes

Re: Dairy and Yearly Cron not working.
« Reply #7 on: October 18, 2023, 03:21:04 PM »
Replace that function with following:
Code: [Select]
function osc_get_current_url() {
  if(isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) {
    return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  }

  return false;
}
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots