? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
27 Feb 2021

Pull Request for Issue # .

Summary of Changes

This is my attempt to improve the code add breadcrumbs in category view. Currently, the code is messy, hard to understand and could contains potential issue (wrong value for $id variable if you read the code - there is a reason we use @ in the code $id = (int) @$menu->query['id'];)

Testing Instructions

  1. Access to Content -> Categories, create several categories and sub-categories)
  2. Apply patch
  3. Test and make sure the breadcrumbs are still handled properly

Test 1:

  • Create a menu item to link to Categories List menu option.
  • Access to that menu item, see categories list. Access to parent category and child category, look at the breadcrumps module, make sure breadcrump items are added properly (should have the format Home -> Menu Item Title -> Parent Category -> Child Category)

Test 2:

  • Create a menu item to link to Category Blog menu option.
  • Access to that menu item, look at look at the breadcrumps module, make sure breadcrump items are added properly (should have the format **Home -> Menu Item Title)

If someone can review the code changes, that would be great.

avatar joomdonation joomdonation - open - 27 Feb 2021
avatar joomdonation joomdonation - change - 27 Feb 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2021
Category Front End com_content Libraries
avatar joomdonation joomdonation - change - 27 Feb 2021
Labels Added: ?
avatar toivo toivo - test_item - 27 Feb 2021 - Tested successfully
avatar toivo
toivo - comment - 27 Feb 2021

I have tested this item successfully on 620e924

Tested successfully in Beta8-dev of 27 February in Wampserver using PHP 8.0.2.

There is one anomaly which happens with or without this patch and could be addressed in a separate issue report:

My Main Menu has two items, My Category List and My Category Blog. Every time My Category List is selected and an article or subcategory is accessed, the first part of the breadcrumb after Home shows My Category Blog, instead of My Category List. Something wrong in routing perhaps?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32535.
avatar joomdonation
joomdonation - comment - 27 Feb 2021

@toivo Maybe it is because from categories list page, you access to a category. And for that category, you created a menu item and select that category in the menu item parameter? If so, that's how Joomla routing works and it is expected behavior

avatar toivo
toivo - comment - 27 Feb 2021

@joomdonation - you are right, both menu items, Category List and Category Blog, display articles from the same category or categories in the same branch of the category tree.

If that is expected behaviour, it means that a website cannot have both Category List and Category Blog that list articles from the same category. In other words, a Category Blog should not list articles from from a subcategory, the main category of which is displayed as Category List. BTW, the incorrect element in the breadcrumb is not the alias of the other category but the alias of the menu item that displays the Category Blog based on the other category.

This restriction should be documented to emphasize that in case Category List and Category Blog need to co-exist, they need to refer to separate branches of the category tree. If the categories involved in the two menu items overlap, parts of the breadcrumb that refer to menu items will display inconsistent information.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32535.

avatar brianteeman
brianteeman - comment - 27 Feb 2021

Right or wrong that has been the behaviour since day 1

avatar particthistle particthistle - test_item - 2 Mar 2021 - Tested successfully
avatar particthistle
particthistle - comment - 2 Mar 2021

I have tested this item successfully on c8576cf

@joomdonation from what I can tell from looking at the code, the before and after tests should effectively give the same result for the breadcrumbs in the category list and category blog views. As such, the test passes.

As per the rest of discussion with @toivo and @brianteeman, the parent items when you look at an article return the user back to the lower numbered version of the Category menu item. Having two views for the same piece of information is not optimal, and ideally is avoided when building a site (ie you either have a Category Blog view OR a Category List view, not both).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32535.

avatar richard67 richard67 - alter_testresult - 9 Mar 2021 - toivo: Tested successfully
avatar richard67
richard67 - comment - 9 Mar 2021

I've restored @toivo 's test result in the issue tracker because the commit after the test which has invalidated the test was just the removal of an unused "use" statement, of which I just have checked that it is correct, i.e. really not used.

avatar richard67 richard67 - change - 9 Mar 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 9 Mar 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32535.

avatar rdeutz rdeutz - change - 18 Mar 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-03-18 18:52:57
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 18 Mar 2021
avatar rdeutz rdeutz - merge - 18 Mar 2021

Add a Comment

Login with GitHub to post a comment