Moving to PHP 8

QuestionsMoving to PHP 8
Tim Moore asked 2 years ago

I upgrading to php-8.1.0 and having a problem with a few pages. Not sure what you will need to troubleshoot this issue, or if it is an issue with your code at all. Please advise.

View post on imgur.com

https://gist.github.com/tmoore88/93c8ecb5ef88c734ce6008723c3e102e

Thanks

Tim

5 Answers
Abu Ghufran Staff answered 2 years ago

Hello,

To debug the issue, You can try following:

  1. Open the grid on browser
  2. Open file lib/inc/jqgrid_dist.php and set display_error option to “on” on top of file.
  3. Go back to the grid on browser, and reload grid from grid toolbar.

It should show the error details in the error box. Share the details and I will try to suggest some solution.

We can also have remote session to debug this case. Email me your time zone and availability on [email protected]

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Tim Moore answered 2 years ago

Abu,

Unfortunately, this did not change the error. It still just says error with no information, I  will email you with availability and time zone.

Thanks

Tim

Abu Ghufran Staff answered 2 years ago

Can you please check php error log for details. Blank shows that error display is off and error details are logged in log file. Without that I can’t tell the reason and solution.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 2 years ago

We can have a remote session as well. For that please email me your available time and timezone at [email protected]

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Tim Moore answered 2 years ago

Abu,

After following your instructions. This function, that totals the sums was causing the issue.

PHP LOG – [07-Feb-2022 19:52:09 Europe/Berlin] PHP Fatal error: Uncaught Type Error: Unsupported operand types: string + string in C:\xampp\htdocs\Kodiaccess_test\time_week_o.php:646

Once I read the error in the logs, the error was easy to fix. I was trying to add strings using a + symbol.

OLD CODE:

function calc_cost2($data){
return number_format((float)$data[“ot_mon”] + $data[“ot_tue”] + $data[“ot_wed”] + $data[“ot_thu”] + $data[“ot_fri”] + $data[“ot_sat”] + $data[“ot_sun”], 2, ‘.’, ”); }

Changed to:

function calc_cost2($data){
return number_format((float)$data[“ot_mon”] + (float)$data[“ot_tue”] + (float)$data[“ot_wed”] + (float)$data[“ot_thu”] + (float)$data[“ot_fri”] + (float)$data[“ot_sat”] + (float)$data[“ot_sun”], 2, ‘.’, ”); }

This issue was resolved. Just lazy code on my part that used to work in 7.

Thanks

Tim

Abu Ghufran Staff replied 2 years ago

Thanks for updating.

Your Answer

11 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?