No Code Attached Yet
avatar ReLater
ReLater
5 Jul 2022

@crystalenka

Related #37679

Steps to reproduce the issue

  • Under some circumstances Google is not happy with the ld+json data for breadcrumbs. Depends on context and settings of breadcrumbs module.
  • Sometimes an empty

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

is created.

My recommended fix

https://github.com/GHSVS-de/GHSVSThings/blob/master/relaterquatch/mod_breadcrumbs/default.php#L114

avatar ReLater ReLater - open - 5 Jul 2022
avatar joomla-cms-bot joomla-cms-bot - change - 5 Jul 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Jul 2022
avatar ReLater ReLater - change - 6 Jul 2022
The description was changed
avatar ReLater ReLater - edited - 6 Jul 2022
avatar crystalenka
crystalenka - comment - 6 Jul 2022

Thanks for the tag.

I'm having trouble understanding the conditions under which this bug happens. The breadcrumbs should always generate at least the current page in the JSON, even if "show current item" is disabled in the module because the JSON does not display to the user.

Could you please elaborate the steps to reproduce the issue so I can take a closer look? Under what circumstances exactly does the issue occur? I'm afraid I don't speak German and Google Translate was not particularly helpful reading the thread you linked.

For the record, my "making google happy again" PR was just about header items that don't have links; I'm not the original code owner here so I'm making educated guesses about the JSON. We may need to loop in someone else who has deeper knowledge of the module's inner workings because this may be a different sort of bug.

avatar ReLater ReLater - change - 6 Jul 2022
The description was changed
avatar ReLater ReLater - edited - 6 Jul 2022
avatar ReLater
ReLater - comment - 6 Jul 2022

Addition: TBH, I think that my recommended solution is the easiest one and is always correct.

avatar crystalenka
crystalenka - comment - 6 Jul 2022

Thanks for the additional context.

I think the real issue is that the home item should be shown in the JSON for correct SEO breadcrumbs regardless of whether it is displayed to the user. (On the homepage as well as sub pages.) Currently, it's only added to the list when the parameter in the module is enabled, which made sense when the module was for users only. Now that the module also adds structured data it is incorrect.

This goes deeper into the module helper than I feel comfortable editing. @roland-d I think at this point any changes would go into 4.2, right? Who would be the best person to take a look here?

avatar ReLater
ReLater - comment - 6 Jul 2022

Deleted by author because wrong.

avatar roland-d
roland-d - comment - 13 Jul 2022

@crystalenka These changes can still go into 4.2 as they would be a bugfix.

Honestly, I have no idea who would be the right person to look at this.

avatar GHSVS-de
GHSVS-de - comment - 14 Jul 2022

There are more issues with ld+json. E.g. the position is calculated wrongly if there are menu headlines in the pathway.

Even if I think that it's wrong to build ld+json in a module I have written some times ago a custom mod_breadcrumbs based upon the core module.

My question before I provide a pr: If I would add an additional module setting like "Add structured data (ld+json)" is that possible for Joomla 4.2 or would that block the pr until Joomla version 8.7.0 or so ;-) ... because I hate it to have open prs over months ;-)

avatar GHSVS-de
GHSVS-de - comment - 14 Jul 2022

I am sorry that I have to withdraw my offer to create a PR. I can't cope with the new Joomla code style hell in my editor and don't want to break its configuration or type and count hundreds of spaces at the moment.

avatar GHSVS-de
GHSVS-de - comment - 14 Jul 2022

@crystalenka

This would have been my pr (based upon J4.1.5). If you or somebody else want to take over just feel free to do so.

It's B\C as far as I see. I've tested it on some "living" sites.

GHSVS-de/mod_breadcrumbsghsvs@ee5d4a2

avatar GHSVS-de
GHSVS-de - comment - 14 Jul 2022
avatar ReLater ReLater - change - 16 Jul 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-07-16 13:27:31
Closed_By ReLater
avatar ReLater ReLater - close - 16 Jul 2022
avatar ReLater
ReLater - comment - 16 Jul 2022

Please test and review #38285

Add a Comment

Login with GitHub to post a comment