Page MenuHomeIn-Portal Phabricator

INP-1551 Add the "kDBList::GetSelectedCount" method and "SelectedRecords" tag using it
ClosedPublic

Authored by glebs on Jun 10 2016, 1:33 AM.

Details

Test Plan

Test Admin console

  1. Add code into core/admin_templates/languages/phrase_list.tpl just after <inp2:m_RenderElement name="combined_header"/> (after line 2)
Selected: <inp2:phrases_SelectedRecords/><br/>
GridInfo: <inp2:phrases_GridInfo type="selected"/>
  1. Login to Admin Console as root
  2. Go to Website & ContentLabels & Phrases
  3. Confirm you see
Selected: 20
GridInfo: 20

just after header

Test Frontend

NOTE: Please use advanced theme with installed content and installed in-commerce module to test
  1. Add Selected: <inp2:c_SelectedRecords list_name="category_search_results"/> to themes/advanced/platform/elements/content_boxes/search_results.elm.tpl inside element <inp2:m_Capture to_var="header"> before closing </inp2:m_Capture>:
  2. Go to Frontend
  3. Search for products via search box with Entire Website option selected.
  4. Confirm you see Category Search Results (13) Selected: 3 in header before categories list.
  5. Go to Admin Console as root
  6. Go to Website & ContentProducts and add 3 Tangible products:
    • click on New Product and select Tangible in dropdown;
    • enter Title, SKU and select Active in Status;
    • click Save
    • repeat 2 more times
  7. Add code into themes/advanced/in-commerce/elements/content_boxes/new_products.elm.tpl just after <inp2:m_RenderElement design="content_box" data_exists="1"> (after line 2)
Selected: <inp2:p_SelectedRecords list_name="new_products" types="new" recursive="true" per_page="2"/>
  1. Add same code in same file just after </table>.
  2. Go to Frontend, Products (last item in menu)
  3. Confirm you see list with 2 products and Selected: 2 just before and just after list.

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

glebs updated this revision to Diff 535.Jun 10 2016, 1:33 AM
glebs retitled this revision from to INP-1551 Add the "kDBList::GetSelectedCount" method and "SelectedRecords" tag using it.
glebs updated this object.
glebs edited the test plan for this revision. (Show Details)
glebs added 1 JIRA issue(s): INP-1551.
alex requested changes to this revision.EditedJun 10 2016, 2:39 AM
alex edited edge metadata.

Also the test plan must test all outcomes of http://qa.in-portal.org/diffusion/INP/browse/branches%252F5.2.x/in-portal/branches/5.2.x/core/kernel/db/dblist.php;16347$532-534 code:

  • list was counted prior to new method being called
  • list wasn't counted prior to new method being called, but more records than fits on per page were selected
  • list wasn't counted prior to new method being called, but per page is -1

P.S.
In Admin Console grids we're always counting list upfront and that's why you have to use Front-End during testing.

core/kernel/db/dblist.php
468–470 ↗(On Diff #535)

Please always call Query.


Inside Query method will auto-abort when list was already queried.

This revision now requires changes to proceed.Jun 10 2016, 2:39 AM
glebs updated this revision to Diff 539.Jun 15 2016, 2:40 AM
glebs edited edge metadata.
  1. Always call Query in kDBList::GetSelectedCount()
  2. Moved to 5.3 branch
glebs edited the test plan for this revision. (Show Details)Jun 15 2016, 2:43 AM
glebs edited edge metadata.
alex requested changes to this revision.Jun 15 2016, 2:52 AM
alex edited edge metadata.

And test is incomplete.

core/kernel/db/db_tag_processor.php
2304 ↗(On Diff #539)

Replace Print with Returns.


Method doesn't print anything.

core/kernel/db/dblist.php
442 ↗(On Diff #539)

Please revert this change.


This change is not on topic.

This revision now requires changes to proceed.Jun 15 2016, 2:52 AM
glebs edited the test plan for this revision. (Show Details)Jun 17 2016, 2:19 AM
glebs edited edge metadata.
glebs edited the test plan for this revision. (Show Details)
In D228#4271, @alex wrote:
  • list wasn't counted prior to new method being called, but more records than fits on per page were selected
  • list wasn't counted prior to new method being called, but per page is -1

Alex, sorry, but I haven't understood what these cases mean

glebs updated this revision to Diff 541.Jun 17 2016, 2:22 AM
glebs edited edge metadata.
glebs edited the test plan for this revision. (Show Details)

Requested changes

alex requested changes to this revision.Jun 17 2016, 3:12 AM
alex edited edge metadata.

Alex, sorry, but I haven't understood what these cases mean

This means updating test plan to affect all code paths in http://qa.in-portal.org/diffusion/INP/browse/branches%252F5.2.x/in-portal/branches/5.2.x/core/kernel/db/dblist.php;16347$532-534 code fragment.

This revision now requires changes to proceed.Jun 17 2016, 3:12 AM
glebs requested a review of this revision.Jun 23 2016, 3:20 AM
glebs edited the test plan for this revision. (Show Details)
glebs edited edge metadata.
glebs edited edge metadata.
alex accepted this revision.Nov 20 2016, 6:01 AM
alex edited edge metadata.
This revision is now accepted and ready to land.Nov 20 2016, 6:01 AM
This revision was automatically updated to reflect the committed changes.