Sort error after upgrading to PHP 7.1

khofm

New member
Hello,

First of all: I like dadabik and think it is a great tool. It has been very helpful to me over the last 10 years.

I am on version 7.3.3 and recently upgraded to PHP 7.1. On PHP 5.6 everything was just working fine.

Dadabik is loading and working for the most part. The only issue I am encountering is when trying to sort.

When clicking on one of the field names I get this error message:

[pre]
Warning: A non-numeric value encountered in index.php on line 1178
Warning: A non-numeric value encountered in index.php on line 1255
Warning: A non-numeric value encountered in include/business_logic.php on line 6327
[/pre]


These are the corresponding lines:

[pre]
1178: $res_records = execute_db_limit($sql, $conn, $records_per_page, $page*$records_per_page);
1255: txt_out ("       <font class=\"page_n_of_m\">".$normal_messages_ar["page"].($page+1).$normal_messages_ar["of"].$pages_number."</font>");
6327: $page_group = (int)($page/10); // which group? (from 0......n) e.g. page 12 is in the page_group 1
[/pre]

Sorting does still work though. It will always sort DESC when clicking on a field name. Then the error message will be displayed. Clicking again will not change the sorting to ASC. It will always stay sorted DESC.


Any ideas why this is happening after the upgrade to PHP 7.1?

Thanks
khofm
 

eugenio

Administrator
Staff member
Hello khofm and thanks for the appreciation.

DaDaBIK 7 is not fully compatible with PHP 7, apart from this warning you might get others. To avoid that, I suggest to upgrade to the last version, which also fixes other problems and security issues.

Best,
 

khofm

New member
Hi Eugenio,

Due to customization upgrading is not a simple process.

Any chance you have documentation on what's not compatible with PHP 7.1 in Dadabik 7.3.3?

Thanks
Kai
 

eugenio

Administrator
Staff member
For this specific warning, adding (int) when you assign the values to $records_per_page and $page at the beginning of index.php might solve the problem, you have it at least in two pieces of code:

$records_per_page = (int)$_GET["records_per_page"];

$page = (int)$_GET["page"];

however there are other parts of the code that have been changed to support PHP 7, some of the changes are related to DaDaBIK 8 or even 9 so it would be difficult to provide them.

What kind of customization did you apply? Consider that DaDaBIK 8 and 9 have these new features: custom buttons, layout and operational hooks, calculated fields, custom javascript functions triggered by events that make the customization process easier and cleaner.

Best,
 
Top