In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
579 [In-Portal CMS] Other task always 2010-02-15 16:22 2010-07-22 15:06
Dmitry  
alex  
normal  
closed  
fixed  
 
none 5.1.0-B1  
http://groups.google.com/group/in-portal-dev/browse_thread/thread/c722936e20596265
Better handling for PerPage, SortBy and Page URL parameters
0
0000579: Ability to use PerPage, SortBy and Page params from URL Query
We are looking for a way to extend functionality for using PerPage,
SortBy and Page params from URL Query. Here is a quick outline of
things to do:


New Query Params Usage:

1. Tag PageLink will include parameters "page,per_page,sort_by" from
request, when available (only pass them, when differ, from default
values from unit config of that prefix)

2. Pass main_list="1" to InitList/PrintList of main list on the page
(one list per page)

3. When main_list parameter is given, then during list initialization
use page,per_page,sort_by from url to initialize list

4. Remove "action" attribute from <form> tags on front-end

5. Events OnSetPage, OnSetPerPage, OnSetSorting* should not add
associated with them url parameter (page,per_page,sort_by), when it's
value is equals to default value from unit config of main list being
used.


New Query Params Storage:

1. don't store page,page,sorting in session on Front-End (setting in
debug.php)

2. store page,page,sorting in cookie (expiration until browser is
closed) in format "<prefix>_var", e.g. "product_page".
related to 0000107closed  (5.1.0)alex Implement "MemCached" functionality 
parent of 0000913closed  (5.1.1)alex Warning, when unit doesn't have ListSortings option 
parent of 0001042closed  (5.1.3)alex Broken Pagination for Sub-Items Grids 
related to 0000795closed  (5.1.0)alex Issues with Pagination on Form Submissions grid 
patch per_page_in_unit_configs.patch (37,875) 2010-02-23 14:03
http://tracker.in-portal.org/file_download.php?file_id=290&type=bug
patch per_page_in_unit_configs_core.patch (70,427) 2010-02-24 04:43
http://tracker.in-portal.org/file_download.php?file_id=296&type=bug
patch per_page_in_unit_configs_themes.patch (5,751) 2010-02-24 05:02
http://tracker.in-portal.org/file_download.php?file_id=297&type=bug
patch per_page_in_unit_configs_themes-Advanced-Dmitry-20100425.patch (16,207) 2010-04-25 19:03
http://tracker.in-portal.org/file_download.php?file_id=482&type=bug
Issue History
2011-04-19 22:20 Dmitry Relationship added parent of 0001042
2010-10-31 05:58 alex Relationship added parent of 0000913
2010-07-22 15:06 alex Note Added: 0002557
2010-07-22 15:06 alex Status resolved => closed
2010-07-10 05:16 alex Relationship added related to 0000795
2010-04-26 16:02 alex Note Added: 0001959
2010-04-26 16:02 alex Status reviewed and tested => resolved
2010-04-26 16:02 alex Fixed in Version => 5.1.0-B1
2010-04-26 16:02 alex Resolution open => fixed
2010-04-26 16:01 Dmitry Note Added: 0001958
2010-04-26 16:01 Dmitry Assigned To Dmitry => alex
2010-04-26 16:01 Dmitry Status needs testing => reviewed and tested
2010-04-26 15:59 alex Assigned To alex => Dmitry
2010-04-26 15:59 alex Status needs work => needs testing
2010-04-26 15:59 alex Changeset attached 5.1.x r13405
2010-04-26 15:57 alex Changeset attached 1.1.x r13404
2010-04-25 19:15 Dmitry Change Log Message => Better handling for PerPage, SortBy and Page URL parameters
2010-04-25 19:13 Dmitry Note Edited: 0001940 bug_revision_view_page.php?bugnote_id=0001940#r451
2010-04-25 19:12 Dmitry Note Added: 0001940
2010-04-25 19:12 Dmitry Assigned To !COMMUNITY => alex
2010-04-25 19:12 Dmitry Status needs testing => needs work
2010-04-25 19:03 Dmitry File Added: per_page_in_unit_configs_themes-Advanced-Dmitry-20100425.patch
2010-04-25 18:20 Dmitry Note Edited: 0001482 bug_revision_view_page.php?bugnote_id=0001482#r445
2010-02-27 04:44 alex Developer => alex
2010-02-24 05:14 alex Note Edited: 0001482 bug_revision_view_page.php?bugnote_id=0001482#r391
2010-02-24 05:12 alex Note Added: 0001482
2010-02-24 05:12 alex Assigned To alex => !COMMUNITY
2010-02-24 05:12 alex Status needs work => needs testing
2010-02-24 05:02 alex Changeset attached 1.1.x r13160
2010-02-24 05:02 alex File Added: per_page_in_unit_configs_themes.patch
2010-02-24 04:45 alex Changeset attached 5.1.x r13159
2010-02-24 04:43 alex File Added: per_page_in_unit_configs_core.patch
2010-02-23 14:12 alex Changeset attached 5.1.x r13158
2010-02-23 14:12 alex Changeset attached 5.1.x r13157
2010-02-23 14:11 alex Changeset attached 5.1.x r13156
2010-02-23 14:10 alex Changeset attached 5.1.x r13155
2010-02-23 14:09 alex Changeset attached 5.1.x r13154
2010-02-23 14:09 alex Changeset attached 1.1.x r13153
2010-02-23 14:03 alex File Added: per_page_in_unit_configs.patch
2010-02-15 16:22 Dmitry Relationship added related to 0000107
2010-02-15 16:22 Dmitry New Issue
2010-02-15 16:22 Dmitry Status active => needs work
2010-02-15 16:22 Dmitry Assigned To => alex
2010-02-15 16:22 Dmitry Reference => http://groups.google.com/group/in-portal-dev/browse_thread/thread/c722936e20596265

Notes
(0001482)
alex   
2010-02-24 05:12   
(edited on: 2010-04-25 18:20)
Because of a lot of changes I've commited them before testing, so it would be easier to test later.

Main list is list in front-end template, that has been initialized using main_list="1" parameter in InitList tag. Changes described above will only affect Front-End. Please test, that Admin lists are not broken.

Changes made:
=============
1. Url parameter "sort_by" is added to urls, when non-default sorting is selected for main lists instead of storing sorting in session (Front-End Only).

2. New parameter "PerPage" added to each prefix query string in it's unit config resulting per-page change to appear in "env" variable in url instead of session (for main lists only and when mod-rewrite is off).

3. New parameters "per_page" and "page" added to url to represent current per-page and page in main list (ONLY when mod-rewrite is on) preventing them from being stored in session.

Notes:
======
1. It's possible, that not all main lists in all themes have main_list="1" parameter passed, so it also needs to be checked.

2. Only one list per-page page can be marked as main list and will react to url parameters mentioned above.

3. I've changed query string for some in-auction module unit configs as well, that contained custom "type" component in them. That component now has different position in query string, so if there is any code with hardcoded "env" strings using that prefixes, then it won't work.

I was unable to find examples of that code or any uses of "type" parameter though.

(0001940)
Dmitry   
2010-04-25 19:12   
(edited on: 2010-04-25 19:13)
Tested and mostly it's working as expected - Good!


A few comments, questions:

1. Please find attached patch for Advanced theme - it should replace your Theme patch.

2. Based on your statement:

New parameters "per_page" and "page" added to url to represent current per-page and page in main list (ONLY when mod-rewrite is on) preventing them from being stored in session.

BUT I believe I still get the opposite:

http://www.jurmala.com/SVN/in-portal-5.1.x/index.php?env=-in-commerce/products/search_results:m0-1-1-4-s-:p--1-20--&sort_by=Price,desc&per_page=20

In the end it works correctly, but I have noticed it's controversial with your statement!


3. What will happen with other Pagination and sorting lists that don't have Main_list="1" passed?

For example:

a. I have 2 lists on the same page (very rare, but possible - ie. eGov site) - Categories with Sorting/Pagination/PerPage and Links with Sorting/Pagination/PerPage

b. I have list of Orders under MyAccount - am I able to have Sorting/Pagination for that list?


I believe we are close to getting it done here!

Thanks.

(0001958)
Dmitry   
2010-04-26 16:01   
Fixes applied (by alex, test locally by myself) - ready to commit.
(0001959)
alex   
2010-04-26 16:02   
1st and 2nd item from 0000579:0001940 note fixed and commited.

3rd item will be tested on Beta testing phase.
(0002557)
alex   
2010-07-22 15:06   
Closing, since 5.1.0 release has been released.