Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » PHP 8 - ListViewPrintAfter()
PHP 8 - ListViewPrintAfter() [message #7805] Thu, 16 March 2023 08:40 Go to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
When calling an output2 pattern with php 8, I get the following error message:

Uncaught exception from TypeError, message = array_merge(): Argument #2 must be of type array, null given, code=0, file=C:\xampp\htdocs\radicore\includes\std.pdf.class.inc, line=1751 (# 256)

Error in line 496 of file 'C:\xampp\htdocs\radicore\includes\error.inc'.

PHP_SELF: /radicore/htm/training_plan_anwesenheit_gesamt(output2).php

Is it in my code or because of changing php version?
Re: PHP 8 - ListViewPrintAfter() [message #7806 is a reply to message #7805] Thu, 16 March 2023 09:22 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
This error shows that the following call
$after2 = $dbobject->_cm_ListView_print_after($current_row, $next_row);
is returning a result which is NOT an array. You need to find that code and fix it.


Re: PHP 8 - ListViewPrintAfter() [message #7807 is a reply to message #7806] Thu, 16 March 2023 12:23 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Yes, I feared that.

I still have problems working with my debugger because I have no experience. I use xdebug in eclipse. Do you have some advice for me, where I can find a manual or a link how to work with this best? I only find videos or documents with descriptions to set it up properly.

Or is there a better solution to work with?
Re: PHP 8 - ListViewPrintAfter() [message #7808 is a reply to message #7807] Fri, 17 March 2023 06:34 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
In line 1745 of std.pdf.class.inc there is the code: $after2 = $dbobject->_cm_ListView_print_after($current_row, $next_row);

In my custom method _cm_ListView_print_after() is $current_row an array with the values of the last record. $next_row isn't an array. It is a boolean variable with value false.

Do I have to change $next_row in _cm_ListView_print_after()? And if yes, how can I do this? Because the return value is $output.
Re: PHP 8 - ListViewPrintAfter() [message #7809 is a reply to message #7808] Sat, 18 March 2023 06:07 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
$next_row is set to FALSE if there is no next row. This always happens at end-of-file (EOF). Before you attempt to use the contents of $next_row you should check that it is not empty.

Similarly in the _cm_ListView_print_before() method the $prev_row parameter will be empty if there is no previous record. This always happens when you start by reading the first record.


[Updated on: Sat, 18 March 2023 06:08]

Report message to a moderator

Re: PHP 8 - ListViewPrintAfter() [message #7810 is a reply to message #7809] Mon, 20 March 2023 10:34 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
I found my bug. It was in the code of my _cm_ListView_print_after ($curr_row, $next_row) method. The $output = array() was in an if-clause. If false then $output was not set and $after2 was a boolean variable.
Re: PHP 8 - ListViewPrintAfter() [message #7811 is a reply to message #7810] Tue, 21 March 2023 05:31 Go to previous message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I'm glad you have found and fixed the problem.

Previous Topic: Cannot delete audit data
Next Topic: Error with date field
Goto Forum:
  


Current Time: Tue Dec 03 11:44:54 EST 2024

Total time taken to generate the page: 0.01307 seconds