Page MenuHomeIn-Portal Phabricator

INP-1379 - Don't query related items, when main item isn't found
Needs ReviewPublic

Authored by erik on Sep 25 2014, 9:51 AM.

Details

Reviewers
alex
Test Plan
  1. Put somewhere in the index.tpl of advanced theme tag for related pages output: <inp2:m_RenderElement name="platform/elements/content_boxes/related_items.elm" design="blue_box"/>
  2. Open front-end index page with debug mode on.
  3. Confirm that no SQL error happens.
  4. Add "?m_cat_id=n" to the URL of index page, where n is Id of some category, which has related categories.
  5. Load page with URL from previous step.
  6. Confirm that made correct output of related pages.

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 91
Build 91: arc lint + arc unit

Event Timeline

erik updated this revision to Diff 12.Sep 25 2014, 9:51 AM
erik retitled this revision from to SQL error, when printing related pages.
erik updated this object.
erik edited the test plan for this revision. (Show Details)
erik added a reviewer: alex.
erik set the repository for this revision to rINP In-Portal.
erik added 1 JIRA issue(s): INP-1379.
alex requested changes to this revision.Sep 25 2014, 10:02 AM
alex edited edge metadata.
alex added inline comments.
core/kernel/db/cat_event_handler.php
509

Instead we need to check if actual $p_item was loaded from database and if it wasn't then we basically:

  • add FALSE to $type_clauses['related']['include']
  • add TRUE to $type_clauses['related']['exclude']

Also repeat that change in other Event Handler.

This revision now requires changes to proceed.Sep 25 2014, 10:02 AM
alex added a comment.Nov 23 2014, 3:11 AM

Adding comment to create corresponding "Issue Link" from JIRA Issue back to this Differential Revision.

alex retitled this revision from SQL error, when printing related pages to INP-1379 - SQL error, when printing related pages.Dec 7 2014, 3:30 PM
alex edited edge metadata.
alex set the repository for this revision to rINP In-Portal.Dec 7 2014, 3:42 PM
erik edited the test plan for this revision. (Show Details)Apr 16 2015, 4:11 AM
erik edited the test plan for this revision. (Show Details)
erik edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)Apr 16 2015, 4:16 AM
erik updated this revision to Diff 156.Apr 23 2015, 12:39 PM
erik edited edge metadata.

Added check for item, loading for database and changed related logic.

alex requested changes to this revision.May 19 2015, 7:41 PM
alex edited edge metadata.
alex added inline comments.
core/units/categories/categories_event_handler.php
423

Remove this, because you've moved this variable declaration up to 402 line.

This revision now requires changes to proceed.May 19 2015, 7:41 PM
erik updated this revision to Diff 261.Aug 24 2015, 5:01 AM
erik edited edge metadata.

Removed excessive declaration of $related_ids variable.

alex retitled this revision from INP-1379 - SQL error, when printing related pages to INP-1379 - Don't query related items, when main item isn't found.Mar 27 2016, 8:02 AM
alex edited edge metadata.