Description to reproduce the issue as follows:
Going to Custom Block Library -> Block types (admin/structure/block/block-content/types)

Now selecting “Manage Fields”

You are getting here

Now if you click “Custom Block library” in the Breadcrumbs section you get taken to here (the blocks section of the Custom block library)

While one would expect to be taken to the “Block types” section of the Custom block library (see first image) where you were coming from.
I am considering this as to be an inconsistent workflow. This in not only applying to “Manage fields” operation but to all operations.
Changing the routing paths can make this work in a more consistent way.
Will provide a patch for this.
Comments
Comment #2
stefan.kornComment #3
stefan.kornComment #6
stefan.kornFixed tests.
Comment #7
larowlanThe issue here is that by changing paths, we might be breaking things.
We can however, fix breadcrumbs without changing paths, by adding a new breadcrumb builder.
I think avoiding the BC break by adding a builder may be the path of least resistance.
Comment #9
stefan.kornOk, seems to be a valid precaution not to changes paths, but adding Breadcrumb builder service.
And nice to hear about that service too ;-) Digging a little into this Breadcrumb builder service by looking here and there and finally got something working. So how about this patch as a first shot?
One thing I am not sure about is this
addCacheableDependency(). Put it in because without it there seems to be a caching issue.I am very open to improvements on this.
Just for the record:
I think the paths for the block content type administration are not consistent themselves, you have
admin/structure/block/block-content- for the custom blocksadmin/structure/block/block-content/types- for the custom block typesand then
admin/structure/block/block-content/manage/{type}for managing the custom block types, this should beadmin/structure/block/block-content/types/manage/{type}imho. Then the breadcrumbs would be more consistent too without the need to add breadcrumb builder service.But I am perfectly fine with changing only the breadcrumbs, because I think the breadcrumbs are the real UX deficit here, while the paths are more a "cosmetic" change and can be avoided if it is too risky breaking something.
Comment #10
stefan.kornComment #12
stefan.kornHm, trying to fix this test failure.
Comment #13
stefan.kornComment #15
stefan.kornOne more try.
Comment #16
stefan.kornComment #17
larowlanThis is looking great!
Some observations
100 is quite high - if we do need 100, can we document in a comment in the services.yml why it is so high - i.e.
Needs to be 100 to run before {some other service}.If not, lets make it something lower.
This would match on /block/add/{block_content_type}, so we should probably just whitelist the routes we're dealing with. We can't know all routes that include {block_content_type} - there may be many in contrib.
Our coding standards require
{to be on same line as theifI don't think we need this.
If there are caching issues, we should
$breadcrumb->addCacheContexts(['url'])->addCaceableDependency($route_match->getParameter('block_content_type');I don't think 0 is a valid value
whitespace issue here
Nice!
Also, I agree on the general question of changing the paths, we have #2501691: Change content-types, comment-types, and block-types URLs for that, as its a broader discussion covering other entity types too.
Comment #18
harsha012 commentedTried to fix some of the issue still setting this to NW.
fixed below points
Regarding the point #17.1 let #15 make a call on this.
Comment #19
stefan.kornOk, was busy for a few days. Now here a new version of the patch.
Tackling the observations of @larowlan (thanks for taking the time and quick response) as follows:
1. took the priority completely out. Seems to work without priority just like before. I do not have a special reason for the priority settings, took it out of some example.
2. I am open to whitelisting routes manually here and did already think about it and even used this in first steps towards this patch. But then I came to think about how to maybe get all relevant paths automatically and using parameter check therefore.
In a very basic scenario you have the tabs "Edit", "Manage fields", "Manage form display" and "Manage display". So now you work with translation, there comes a new tab "Translate custom block type". And then I am using devel module which brings a tab "Devel", and other contrib modules might bring there own tabs as well. So with checking for the parameter I get all the tabs without the need to whitelist routes like that for translation or even that for devel and any unknown modules that create tabs here.
And about
I was thinking about how a contrib module should use {block_content_type}. I think they maybe add a tab to the block content type, which would then be perfectly ok. But would they possibly also do some things with {block_content_type} completely out of the scope of the "Block types" section and would that be valid?
Regarding /block/add/{block_content_type}, yes I overlooked this. But how about improving this breadcrumb as well, see patch?
And for /admin/structure/block/block-content/manage/{block_content_type}/delete it also matches but it is delivering a reasonable breadcrumb here too.
So maybe
if($route_match->getParameter('block_content_type')) {could be valid?3. should now be fixed
4. it did not work with the line you gave, but it works with just
$breadcrumb->addCacheContexts(['route']);- Took this out of some other BreadcrumdBuilder examples.5. should now be fixed
6. thanks - making the tests work is sometimes the hardest part ...
Comment #20
stefan.kornComment #21
larowlannit: this needs a class docblock
nit - should be
{@inheritdoc}nit, these are string so we should be strict - i.e.
===and!==I am comfortable with that living inside the same trail, even though the path doesn't - but we should get sign off from the usability team. If we do it for /block/add/{type} then we would need to do it for /block/add too I think.
Can you paste screenshots of the before/after for the main routes impacted by this patch, including block/add and block/add/{type} - that will make their review easier
Comment #22
stefan.kornOk, this is a patch which should hopefully fix the nits and add breadcrumb for block/add as well.
Screenshots will follow
Comment #23
stefan.kornPlease find screenshot of main routes that are affected by this patch below
Screenshot for the block/add route:

Screenshot for the block/add/block_content_type route:

Screenshot for the delete block type route:

Screenshot for the edit block type route:

Screenshot for the manage fields on block type route:

Comment #25
stefan.kornComment #26
stefan.kornHi, is there anything else I should do on this?
The failed test was due to some general problem I think. I retested and it passed then.
Comment #27
larowlanCan you provide an interdiff for #22 to save needing to re-review the whole patch.
If you don't have local branches and its going to be difficult, let me know and I'll review from scratch
Comment #28
stefan.kornOk, this is my first interdiff. So please check if this ok and bear with me if it's not ok.
I made two interdiffs, one between 15 and 22 and the other between 19 and 22. Please choose the one that is better for you.
Comment #29
larowlanCode looks good to me, we just need the usability team to sign off on this, tagging for review.
Comment #35
abhijith s commentedPatch #22 can't be applied in 9.2.x.Needs reroll.
Comment #36
abhijith s commentedRerolled patch #22.Please check it.
Comment #37
abhijith s commentedFixed the CS issue
Comment #38
raman.b commentedFixing the cspell issue and fixing a failing test case
Comment #42
smustgrave commentedSo I am not seeing this with claro?
Is this a seven issue? If so this ticket may need to be moved to https://www.drupal.org/project/seven
Comment #43
stefan.kornThis issue is the same with Claro, it is not a Seven issue.
So, are you the maintainer that needs more info? I thought maintainer already given consent in #29, therefore wondering about the status "Postponed (maintainer needs more info)".
I suppose "usability review" is still needed and maybe one should try if patch still applies on latest HEAD.
Comment #44
stefan.kornmade new patch against latest HEAD (9.5.x)
Comment #45
ranjith_kumar_k_u commentedFixed CS errors.
Comment #47
ranjith_kumar_k_u commentedComment #48
ranjith_kumar_k_u commentedComment #49
smustgrave commentedMore info
You can follow https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-... for how to fill in the issue summary field.
Mainly
What are the steps to reproduce? Helps the reviewer and committer.
What's the proposed solution?
Also we will need a tests-only patch to verify that the tests are covering the issue.
Comment #51
smustgrave commentedThis will be resolved when https://www.drupal.org/project/ideas/issues/3318110 lands.
Comment #52
stefan.kornOkay then, let's linger this for another few years maybe. I am unfollowing this issue now, for the sake of my nerves.
Comment #53
aaronmchaleRemoving the usability review tag, as the usability group is already focusing on fixing this problem as part of #3318110: [meta] Reorganize Block items in the administration menu and its child issues.
Comment #54
aaronmchaleOn review this issue (again), I'm closing it as outdated, because changes introduced to 10.1 in #2987964: Move custom block types admin link to admin/structure have inadvertently resolved this issue.
In 10.1, Block types have moved up to the top level of Structure, thus the breadcrumb now correctly takes you to the block types list: