Problem/Motivation

Drupal\menu_trail_by_path\Path\CurrentPathHelper::getUrls() can be called multiple times per request and always returns the same result. This can affect overall site performance.

Proposed resolution

Store the result in a property on the object and use that value for subsequent calls.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 store_trail_urls_in_a-2867790-2.patch1.03 KBmbovan

Comments

mbovan created an issue. See original summary.

mbovan’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

Providing a patch.

berdir’s picture

I'm not sure if we want to support a changing path, e.g. for subrequests, but I don't really see how that would make sense, active trails are afaik also statically cached

berdir’s picture

Status: Needs review » Closed (duplicate)

This is superseded by #2910494: Performance issues when having high amount of menu items, the code no longer exists in 2.x.