Topic: A non-numeric value encountered in \includes\date_functions.inc
Hi,
I am getting numerous non-numeric value errors in date_functions.inc line 399 (like below).
A non-numeric value encountered in file: D:\Users\shipl\htdocs\fa24\includes\date_functions.inc at line 399
D:\Users\shipl\htdocs\fa24\includes\date_functions.inc:531: date2sql('2019/Mar/5')
D:\Users\shipl\htdocs\fa24\includes\references.inc:125: explode_date_to_dmy('2019/Mar/5')
D:\Users\shipl\htdocs\fa24\includes\references.inc:252: (references Object)->_parse_next('1','',(Array[3]))
D:\Users\shipl\htdocs\fa24\gl\gl_bank.php:203: (references Object)->get_next('1','','')
D:\Users\shipl\htdocs\fa24\gl\gl_bank.php:35: create_cart('1','0')
This issue seems to be due to the handling of non-numeric months (like in date formats 3,4,5). I am using date format 5 (YYYYMmmDD - 2019/Mar/5) in \includes\date_functions.inc
if ($year+$day+$month) {
if ($how > 2)
{
global $tmonths;
$month = array_search($month, $tmonths);
}
I believe that this should be
if ($how > 2)
{
global $tmonths;
$month = array_search($month, $tmonths);
}
if ($year+$day+$month) {
The patch file is
399,404d398
< if ($how > 2)
< {
< global $tmonths;
< $month = array_search($month, $tmonths);
< }
<
406c400,405
< //to modify assumption in 2030
---
> if ($how > 2)
> {
> global $tmonths;
> $month = array_search($month, $tmonths);
> }
> //to modify assumption in 2030
Hope this helps