Hi all,
I am using Drupal Drupal core 8.2.6, REST UI 8.x-1.13, Rest menu items 8.x-1.2.
And I could not use the max_depth and min_depth, I have tried both as:
/en/api/menu_items/main?_format=hal_json&max_depth=1
/en/api/menu_items/main?_format=hal_json&min_depth=1
But I cannot see any change.
I guest that it is a bug, but could be that I don't know how to use it properly?
Apart of that I have a question, is posible to get just an item of the menu and print its submenu links?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | rest_menu_items-caching_depth-2850119-12135620-8.3.3.patch | 5.08 KB | breidert |
| #3 | rest_menu_items-caching_depth-2850119-11918902-8.3.3.patch | 3.87 KB | breidert |
Comments
Comment #2
fabianderijkHi dimr,
I guess this is a bug then. I will take a look at it ASAP.
As far as selecting just 1 item and showing it's children, it is not possible at this moment. But it could be a nice addition. Do you have any idea's on how to select that one item? Based on the menu item ID probably?
Comment #3
breidert commentedAttached is a patch that fixes the issue.
I also added caching to the ResourceResponse so the parameters min_depth and max_depth are respected.
Comment #4
breidert commentedI noticed that the properties
are missing.
Comment #5
breidert commentedAttached is an updated patch that adds weight, expande, and enabled.
Also a small improvement to caching. Cache context is only set to url.query_args if minDepth and maxDepth are not 1.
Comment #7
fabianderijkThis issue is fixed in the new 8.x-1.3 release. Thanks for the patch.