I did some investigation and if the date fails, it returns false (therefore boolean) and then it fails 500 error.
Anyone else have some input on where to look to get to the bottom of this one? This is really stretching my PHP knowledge.
I mean can solve the error by an IF statement and get around the problem. Hoping someone with date troubleshooting experience can send me off in a direction.
Exactly which PHP version did you have before, and which do you have now? Maybe some of those functions changed with the PHP upgrade, at least that would explain the difference in behavior. If so, there are likely sites online explaining what changes need to be madeā¦
Thanks @pgr Im going to have another look today. I was on php 7.4 before. I checked the file on github and it hasnāt had changes for 8 months, so I think the problem has to be the difference in how 7.4 and 8.1 handles the error when the array value is null. Currently its outputting as boolean false which then cannot be converted to a date which then causes the 500. Im still not sure if the problem is that it is null or how the null is handed.
Ok Iāve reverted back to 7.4 and still get the error. So it has to be a change in the upgradeā¦ grr that makes it harder. Iāve reviewed all the file changes on Github going back like a year and not seeing anything that really affects this (I think).
Iāve done a whole bunch of logging and the issue I think is definitively that the array is blank and thus canāt be converted to a date.
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] enddate array count==1: Array
(
[1] => 2024-01-24
)
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] startdate array else: 1
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] enddate-startdate array else:
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] Date string is empty or contains only whitespace.
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] startdate array else: 2
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] enddate-startdate array else:
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] Date string is empty or contains only whitespace.
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] startdate array else: 3
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] enddate-startdate array else:
Fri Jan 19 14:41:11 2024 [27061][1][FATAL] Date string is empty or contains only whitespace.
It seems after the first iteration the enddate array is not getting populated.
Where $enddate_array = []; is supposed to be added at line 330, however, itās actually added in line 613 when you look at the current file. (I think) because itās not on line 330. This causes the the array to clear after the first loop.
Commenting out line 613 solves the problem. Iām going to test placing it at line 330 where I think itās supposed to go.
So initializing the array at line 330 causes no issues and removing it from line 613 solves the problem. So my conclusion is that somehow that particular push from Github put the change on the wrong line??? Not sure how that could happen.
Yes, itās in SuiteCRM 8 as well. I havenāt checked the actual code, but just tested a project creation in my test 8 install from a template and same result 500 error.
@pstevens Important, you have to put the number sign (ā#ā) immediately next to (no spaces in between) the number of the Issue it fixes. Like this: Fix #10321. When you donāt (Fix# 10321), then github fails to associate the Fix with the Issue !! Luckily, you get another chance, github lets you edit it.
Ok will do. Thanks @chris001 for all the coaching around this. I really appreciate it. I donāt use Github everyday and Iām mostly self taught so itās super helpful.