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
Consider the following example of a taxonomy tree:
root
branch
leaf
branch-2 (with absolute path)
leaf
Here root refers to the taxonomy itself, and branch/leaf are the terms of that taxonomy.
I would expect the following paths to the leaf nodes in the tree:
/root/branch/leaf
/branch-2/leaf
However, what I get instead is:
/root/branch/leaf
/root/branch-2/leaf
Note: The AutoroutePart property RouteContainedItems is enabled for both the root and the branches.
Upon examining the code, it appears that AutoroutePartHandler.PopulateContainedContentItemRoutesAsync(...) is responsible for the unexpected routing behavior observed. The basePath parameter is consistently used to create the itemBasePath for contained items, which may not be ideal. It might be more appropriate to use the direct parent's path instead (which might be absolute).
One additional consideration, which is related to this issue, is how scenarios should be handled where the route for a parent/branch is disabled. In such cases, would it be more appropriate to continue using the basePath parameter, or should routing for all child items be disabled as well?
I'd appreciate your thoughts on this. As I've already dug into the code and the solution seems pretty straightforward, I'm up for tackling this one, assuming there aren't any objections.
The text was updated successfully, but these errors were encountered:
I am not sure "with absolute path" is something that was considered. Have you seen that used somewhere or is that something you tries and had expectations it would work?
If you can make it work it's all good, but it might break other parts of the code that assume the autoroute part is hierarchical.
… routes.
- In case that the parent route is disabled and the child rout is not absolute, we should skip routing of that child item.
FixOrchardCMS#15456
Consider the following example of a taxonomy tree:
Here root refers to the taxonomy itself, and branch/leaf are the terms of that taxonomy.
I would expect the following paths to the leaf nodes in the tree:
However, what I get instead is:
Note: The
AutoroutePart
propertyRouteContainedItems
is enabled for both the root and the branches.Upon examining the code, it appears that
AutoroutePartHandler.PopulateContainedContentItemRoutesAsync(...)
is responsible for the unexpected routing behavior observed. ThebasePath
parameter is consistently used to create theitemBasePath
for contained items, which may not be ideal. It might be more appropriate to use the direct parent's path instead (which might be absolute).One additional consideration, which is related to this issue, is how scenarios should be handled where the route for a parent/branch is disabled. In such cases, would it be more appropriate to continue using the basePath parameter, or should routing for all child items be disabled as well?
I'd appreciate your thoughts on this. As I've already dug into the code and the solution seems pretty straightforward, I'm up for tackling this one, assuming there aren't any objections.
The text was updated successfully, but these errors were encountered: