DaDaBIK
This forum is devoted to the discussion about the software DaDaBIK database front-end
the PHP Database application generator for MySQL, PostgreSQL and SQLite; also available for Wordpress.

Welcome! Log In Create A New Profile

Advanced

Sort error after upgrading to PHP 7.1

Posted by khofm 
Sort error after upgrading to PHP 7.1
March 21, 2019 08:56AM
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:

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


These are the corresponding lines:

1178: $res_records = execute_db_limit($sql, $conn, $records_per_page, $page*$records_per_page);
1255: txt_out ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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

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



Edited 1 time(s). Last edit at 03/21/2019 08:56AM by khofm.
Re: Sort error after upgrading to PHP 7.1
March 21, 2019 09:12AM
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,

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Re: Sort error after upgrading to PHP 7.1
March 21, 2019 09:40AM
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
Re: Sort error after upgrading to PHP 7.1
March 22, 2019 01:19AM
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,

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Sorry, only registered users may post in this forum.

Click here to login