? ? Pending

User tests: Successful: Unsuccessful:

avatar GHSVS-de
GHSVS-de
16 Jul 2022

Pull Request for Issue #38229

Fixes also: Position is wrongly set if the menu pathway for example contains Heading menu items.

Summary of Changes

  • Add a helper method getHome() that can be used without redundant code elsewhere to get the home item.
  • Only use $app->getLanguage() if needed.
  • Pick the home item ($homeCrumb) in mod_breadcrumbs.php if showHome is disabled.
  • default.php:
    • Use an independant counter for positions.
    • Always set an itemListElement for startpage even if showHome is disabled.
    • Only set <SCRIPT ld.json> if BraedCrumbList is populated.

Testing Instructions

  • Create a mod_breadcrumbs module. On all pages. Play around with the settings in the following.
  • Build a test scenario with different menu items, menu item types and different menu deepness. Use also menu items with type Heading in between.

The visible breadcrumb hasn't changed with this pr, only the ld+json part.

Either:

In frontend click through your menus and check the source code of displayed codes.
Search for ld+json to find a <script> tag like

<script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"BreadcrumbList","itemListElement":[...]}</script>

Or:

You can also use Browser Addons like "JSON-LD Tester" for chromium browsers (Chrome, Vivaldi ...) which uses Google testing tools.

Both:

  • Check that all menu items are present and represent the correct pathway of the current page.
  • Check that Heading menu items are not.
  • Check that parameters position go from 1 to x in +1 steps.
  • Check that start page (home) is always at position: 1.

Actual result BEFORE applying this Pull Request

  • Empty and invalid "itemListElement":[] on startpage if showHome is disabled in mod_breadcrumbs.
  • Wrong position steps if Heading menu items are present in menu.
  • Missing home entry on deeper pages (?? don't remember).

Expected result AFTER applying this Pull Request

No errors in structured data when testing.

Additional

A legend is going around that the last element must not have a @id (= forbidden) if it's the current page, which is wrong (I've tested that on several pages that use other tools for ld+json). Because I
don't want endless discussions here I've left the old behavior in mod_breadcrumbs (no @id for last element if it's current page).

avatar GHSVS-de GHSVS-de - open - 16 Jul 2022
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jul 2022
Category Modules Front End
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
The description was changed
avatar GHSVS-de GHSVS-de - edited - 16 Jul 2022
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
The description was changed
avatar GHSVS-de GHSVS-de - edited - 16 Jul 2022
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
The description was changed
avatar GHSVS-de GHSVS-de - edited - 16 Jul 2022
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
The description was changed
avatar GHSVS-de GHSVS-de - edited - 16 Jul 2022
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
The description was changed
avatar GHSVS-de GHSVS-de - edited - 16 Jul 2022
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
The description was changed
avatar GHSVS-de GHSVS-de - edited - 16 Jul 2022
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
Labels Added: ?
avatar GHSVS-de GHSVS-de - change - 16 Jul 2022
The description was changed
avatar GHSVS-de GHSVS-de - edited - 16 Jul 2022
avatar ChristineWk
ChristineWk - comment - 16 Jul 2022

I have tested this item successfully on 8ac90ae


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

avatar ChristineWk ChristineWk - test_item - 16 Jul 2022 - Tested successfully
avatar viocassel
viocassel - comment - 17 Jul 2022

I have tested this item successfully on 8ac90ae


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

avatar viocassel viocassel - test_item - 17 Jul 2022 - Tested successfully
avatar richard67 richard67 - change - 17 Jul 2022
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 17 Jul 2022

RTC


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

avatar roland-d roland-d - change - 29 Jul 2022
Labels Added: ?
avatar roland-d roland-d - change - 29 Jul 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-07-29 19:51:46
Closed_By roland-d
avatar roland-d roland-d - close - 29 Jul 2022
avatar roland-d roland-d - merge - 29 Jul 2022
avatar roland-d
roland-d - comment - 29 Jul 2022

Thank you

Add a Comment

Login with GitHub to post a comment