-
Notifications
You must be signed in to change notification settings - Fork 10
Breadcrumb : display basic breadcrumb when the current route not found in the Menu tree #22
Comments
Hi, I'm going to investingate. Can you add your route and your menu ? If the page is not in the menu, what is the expected result for the display ? |
No display ! The itemFilterIterator->current() return null, so the manipulator throw an exception. For example, when you generate CRUD with symfony, it create 6 route :
If (like me) you put the breadcrumb in the base layout. The breadcrumb will throw an exception when you open a page who aren't on the menu. The page "entity_update" is used when the data in form are invalid, why put this on the menu ? Currently, for not crash the breadcrumb ! I understand that without the menu, the breadcrumb will not display the correct name, but i think it shouldn't have to crash, no ? :p That's true, an empty breadcrumb is strange. But I think the itemFilterIterator should return the parent item when it don't find the current matched item. |
If you have a way to use the matcher with url and return the most relevent item (the nearest parent), please, make a PR. Actually, i suggest to have a breadcrumb with the first item. |
Hello,
When you try to generate a breadcrumb on a page that doesn't exist in the menubuilder, the function
return an exception
Why not just return an empty breadcrumb ?
On Twig/MenuExtension.php l.100
Thanks
The text was updated successfully, but these errors were encountered: