Page 1 of 1

Date Problems

Posted: Wed May 22, 2024 4:06 pm
by Xpajun
Just when I thought I had everthing sorted I get the following errors:

Code: Select all

[22-May-2024 12:25:07 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "DATE_FORMAT_LONG" in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php:52
Stack trace:
#0 /home/******/public_html/store/includes/modules/notifications/templates/tpl_n_update_order.php(18): Date::expound('2024-05-21 15:4...')
#1 /home/******/public_html/store/includes/modules/notifications/n_update_order.php(31): include('/home/******/...')
#2 /home/******/public_html/store/includes/system/versioned/1.0.8.3/notifications.php(40): n_update_order->notify(Array)
#3 /home/******/public_html/store/admin/includes/actions/orders/update_order.php(27): Notifications::notify('update_order', Array)
#4 /home/******/public_html/store/admin/includes/segments/process_action.php(19): require('/home/******/...')
#5 /home/******/public_html/store/admin/orders.php(16): require('/home/******/...')
#6 {main}
  thrown in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php on line 52
[22-May-2024 15:40:46 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "DATE_FORMAT_SHORT" in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php:59
Stack trace:
#0 /home/******/public_html/store/admin/includes/modules/dashboard/d_orders.php(53): Date::abridge('2024-05-22 06:2...')
#1 /home/******/public_html/store/admin/index.php(56): d_orders->getOutput()
#2 {main}
  thrown in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php on line 59
[22-May-2024 15:40:53 UTC] PHP Fatal error:  Cannot declare class ht_pages_seo, because the name is already in use in /home/******/public_html/store/includes/modules/header_tags/ht_product_meta.php on line 13
[22-May-2024 15:41:01 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "DATE_FORMAT_SHORT" in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php:59
Stack trace:
#0 /home/******/public_html/store/admin/includes/modules/dashboard/d_orders.php(53): Date::abridge('2024-05-22 06:2...')
#1 /home/******/public_html/store/admin/index.php(56): d_orders->getOutput()
#2 {main}
  thrown in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php on line 59
[22-May-2024 15:42:56 UTC] PHP Fatal error:  Cannot declare class ht_pages_seo, because the name is already in use in /home/******/public_html/store/includes/modules/header_tags/ht_product_meta.php on line 13

I'm taking it that constant "DATE_FORMAT_SHORT" & LONG are the ones defined in english.php - this is mine:

Code: Select all

const DATE_FORMAT_SHORT = '%d/%m/%Y';  // this is used for strftime()
const DATE_FORMAT_LONG = '%d %A %B, %Y'; // this is used for strftime()
const DATE_FORMAT = 'd/m/Y'; // this is used for date()
const DATE_TIME_FORMAT = DATE_FORMAT_SHORT . ' %H:%M:%S';

and the 1.0.8.3 date.php Lines 49-60:

Code: Select all

// Output in the selected locale date format, long version
// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
    public static function expound($raw_date) {
      return (new Date($raw_date))->format(DATE_FORMAT_LONG);
    }

////
// Output in the selected locale date format, shorter version
// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
    public static function abridge($raw_date) {
      return (new Date($raw_date))->format(DATE_FORMAT_SHORT);
    }


Re: Date Problems

Posted: Wed May 22, 2024 10:01 pm
by ecartz
Something keeping the language file from loading?

Re: Date Problems

Posted: Thu May 23, 2024 8:01 am
by Xpajun
ecartz wrote: Wed May 22, 2024 10:01 pm Something keeping the language file from loading?
Yes - I must have accidently altered something and unfortunately can't remember what it may be - affects both front end and admin

Re: Date Problems

Posted: Sat May 25, 2024 9:54 am
by Xpajun
Xpajun wrote: Wed May 22, 2024 4:06 pm

I'm taking it that constant "DATE_FORMAT_SHORT" & LONG are the ones defined in english.php - this is mine:

Code: Select all

const DATE_FORMAT_SHORT = '%d/%m/%Y';  // this is used for strftime()
const DATE_FORMAT_LONG = '%d %A %B, %Y'; // this is used for strftime()
const DATE_FORMAT = 'd/m/Y'; // this is used for date()
const DATE_TIME_FORMAT = DATE_FORMAT_SHORT . ' %H:%M:%S';

Not happy... even though the define above came from my store and was saved the save didn't happened :roll:

I use BBEdit for editing all my files - this non saving is only just started happening
I learnt from this put up with the errors and update to 1.0.9.3 ASAP!

Thanks for your help Matt @ecartz