Pagination links don't work in master/details views

dh

Member
I have another problem with the pager (last time, my problem involved paging through a "contains" clause and was traced back to a mod_security rule that deleted index.php -- see https://dadabik.com/forum/read.php?1,18921,18921#msg-18921)

This time my problem is with master/detail view. I have disabled mod_security proactively since Eugenio already warned me about mod_security's effect on table names with underscores, and this one has underscores in both the master and the detail views. I then restarted apache and the pager problem still occurs so mod_security doesn't seem to be the issue this time.

Here is the first page of a master/detail view:
https://tbed.org/demo/index.php?tablename=county_vw&function=details&where_field=county_geoid&where_value=35001

When you hover or click over page 2 on the pager, you get this URL which completely blows out the master detail view and shows all records instead of just the few remaining on the second page:

https://tbed.org/demo/index.php?tablename=place_vw&function=search&where_clause=place_vw.county_geoid+%3D+%2735001%27&order=place&order_type=ASC&page=1

Eugenio, can you see anything malformed about that URL for the second page of a master/detail? Private message me with your IP if you want access to admin interface. Thank you!


You are using DaDaBIK version 8.0-Lerici enterprise, installed on 05-26-2017 (installation code: 0), the latest version of DaDaBIK is released on --

You are not running the last release of DaDaBIK, the release you are running might have bugs and security holes, see the official change log for further information. You can upgrade DaDaBIK here.

PHP Version: 7.0.22

mysql version: 5.6.35

Web server: Apache

Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8
 

eugenio

Administrator
Staff member
Hello,
this one seems definitely a DaDaBIK bug, thanks for your detailed feedback.

A quick patch that should fix it (I'll post again if I need to add something).

In index.php you have three times this line:

$navigation_tool = build_navigation_tool($where_clause_to_pass, $pages_number, $page, $action, "", $order, $order_type, '', '', '', '', 0);

keep the first instance as it is and change the other two with:

$navigation_tool = build_navigation_tool($where_clause_to_pass, $pages_number, $page, $action, "", $order, $order_type, $master_table_name, $master_table_function, $master_table_where_field , $master_table_where_value, $is_items_table);

Let me know if this works.

Best,
 

dh

Member
That seems to work!

In case anyone else needs to do this, the two lines to be changed in index.php are 2214 and 3276, at least in my install.

Thanks, Eugenio!
 

eugenio

Administrator
Staff member
I confirmed it was a bug, I've changed the title of your post so that other users can find it easily.

Best,
 

uwec

New member
I think i got a problem that goes in the same direction.

In Master/Details view whenever i change the items per page i suddenly get all entries shown.

For example if i got a DB whith several liquids(master) that all consists of about 10 to 50 components(details).

If i change Items per page via the records per page form , the records per page are changed , but now it shows ALL components of ALL liquids.

Version is 8.3-Lerici enterprise, on a Synology Disk Station (Linux)
Tested whith firefox and IE .
As the records per page form is a simple html form , i dont think its a browser speciffic issue.
 

uwec

New member
Sorry forgot this :

PHP Version: 7.0.28
mysql version: 5.5.5-10.0.32-MariaDB
Web server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
 

eugenio

Administrator
Staff member
Hello,
after having analyzed the issue, I can say it is definitely a bug that arises only when you are in edit mode (not in details mode).

Here is a quick fix: open index.php and search this line

$records_per_page_form = build_records_per_page_form($records_per_page, $table_name, "", "", "", "", 0);

you should find two occurrences; change only the second one to:

$records_per_page_form = build_records_per_page_form($records_per_page, $table_name, $master_table_name, $master_table_function, $master_table_where_field , $master_table_where_value, $is_items_table);

let me know if it works as expected.

Best,
 
Top