You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The order of breadcrumbs seems to be wrong when a nested taxonomy is selected as the primary (or only) one. I was able to reproduce this with the normal posts, as well as custom posttypes.
Install 14.1
Enable breadcrumbs and set the taxonomy breadcrumb for posts to be category
Create a post category and 2 child categories
Create a new post and assign the 2 childs and set one of them as primary
Either add the [wpseo_scortcode] to the post, or add it to your theme somewhere, and publish the post
Visit the post on the frontend and notice a wrong breadcrumb order in both the HTML output as well as schema.
Edit the post, removing one of the selected childs so that there is only one selected. Save the post
View the post again, the breadcrumb order is wrong as well
These steps can be reproduced on custom posttypes (like the books from the Yoast Test Helper) as well. Adding more nested layers will keep a wrong order in the breadcrumbs:
Home » Level 1.1 » Level 1 » Level » Boss
Instead of
Home » Level » Level 1 » Level 1.1 » Boss
It also looks like the first visit of a post after resetting the indexables shows the breadcrumbs in the right order. Refreshing the page will mess up the order again. This may be due to the first load of a page using the fallback, and not the indexables, to generate the breadcrumbs?
I got this to work correctly by changing this query:
To use order_by_asc instead of order_by_desc. But this code does not seem to be changed from 14.0.4 (where this does not happen). So I guess it got sorted downstream and that got broken?
The problem is in the fact that the ancestors get stored in a different order in 14.1. Which is why posts created on 14.0.4 are showing correctly. See the linked PR below.
The text was updated successfully, but these errors were encountered:
Continuing from #15071 (comment)
The order of breadcrumbs seems to be wrong when a nested taxonomy is selected as the primary (or only) one. I was able to reproduce this with the normal posts, as well as custom posttypes.
category
[wpseo_scortcode]
to the post, or add it to your theme somewhere, and publish the postThese steps can be reproduced on custom posttypes (like the books from the Yoast Test Helper) as well. Adding more nested layers will keep a wrong order in the breadcrumbs:
Instead of
It also looks like the first visit of a post after resetting the indexables shows the breadcrumbs in the right order. Refreshing the page will mess up the order again. This may be due to the first load of a page using the fallback, and not the indexables, to generate the breadcrumbs?
I got this to work correctly by changing this query:
wordpress-seo/src/repositories/indexable-hierarchy-repository.php
Lines 76 to 80 in 2df9c9c
To useorder_by_asc
instead oforder_by_desc
. But this code does not seem to be changed from 14.0.4 (where this does not happen). So I guess it got sorted downstream and that got broken?The problem is in the fact that the ancestors get stored in a different order in 14.1. Which is why posts created on 14.0.4 are showing correctly. See the linked PR below.
The text was updated successfully, but these errors were encountered: