relateditems .pattern-relateditems-result-browse links broken on non-site rootPath
@seanupton is already working on this.
Since Aug 16, 2017.
Assessment
This issue has not been assessed yet.
Description
If you set anything other than the site root as the rootPath (e.g. a navroot/subsite) in options for the relateditems pattern, the path passed to the AJAX catalog query will be incorrect. This leads to missing results in browse mode everywhere outside of the rootPath.
To duplicate (using mockup master), something like the following:
- Site's nav root is at
/mysite/my-navroot-folder-- so... rootPathcould be set to/mysite/my-navroot-folderin my pattern options- I use a subclass of the server-side widget to inject this, but that seems a trivial detail.
- site root is
/mysite - A folder "animals" exists at
/mysite/my-navroot-folder/animals - Clicking the .pattern-relateditems-browse-results link for "animals" will lead to erroneous path:
/mysite/my-navroot-folder/my-navroot-folder/animalsis passed to@@getVocbaularycatalog query as path, and of course, this path always yields zero results/brains.- This is in part because the rootPath and the currentPath are concatenated without some sort of normalization to their respective relationship to the site root's path.
There is really no way that a non-site-root rootPath works at present. I would like to address this, but a fix is a bit elusive, because:
- Some of this hides behind the abstractions of Select2.
- There is no clear way I understand yet in JavaScript to ascertain the site-root-path in a Plone 5 site (without possibly making an AJAX call).
- We cannot always assume that a duplicated path fragment like
my-navroot-folder/my-navroot-folderis accidental, in the general case. This is the easiest way to generalize to most situations, but it does not solve all possible navroot path choices, and possibly incurs some unwanted technical debt as a workaround.
@thet any thoughts?
- Dominant language
- JavaScript
- Stars
- 57
- Forks
- 103
- Avg merge
- 10h 25m
- Merged PRs (30d)
- 18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plone/mockup
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
04 type: enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100