- Issue created by @les lim
- Status changed to Needs review
over 1 year ago 3:29pm 16 August 2023 - last update
over 1 year ago 34 pass - πΊπΈUnited States les lim
Here's a patch that adds a "canonical_reroute" configuration in preview_link.settings. It defaults to TRUE, and is overrideable via normal means (i.e., settings.php).
- πΊπΈUnited States draenen
Thanks for the patch. Our client was also confused by this "feature" and it should definitely be configurable.
- π¦πΊAustralia nterbogt
This is causing significant user complaints for our site too. There are many people confused about what is happening and why.
I'm trying to get this to RTBC, but will have to come back a bit later.
- πΊπΈUnited States chrisolof
I just ran into this odd default behavior while evaluating the module. It looks like it's useful (perhaps needed?) when granting a multi-entity preview via a single link. More details in #3155009: Grant access to multiple entities by using a single preview link β .
For single-entity preview links, however, this redirection behavior feels like a bug. I would expect to see the preview-version through the preview link and the regular version through the regular link.
I'm tempted to provide an alternative patch that leaves this redirection in place for multi-entity preview links, but removes it for single-entity preview links where it seems unnecessary and confusing.
- πΊπΈUnited States chrisolof
Attached is an alternative patch that attempts to resolve the issue here by restricting the canonical rerouting behavior to just multi-entity preview links, where it seems to serve a purpose.
It may make sense to go even further with another restriction: only apply the reroute behavior if the entity's latest revision is unpublished. That would allow this rerouting behavior on multi-entity preview links to drop out automatically as preview-versions of entities become published (and thus the preview link is no longer needed to see the latest version).
I'm also re-titling the issue to "Canonical reroute behavior is confusing & feels unnecessary in many situations", switching it to a bug report, and adding these alternate resolution ideas into the list of proposed resolutions.
- πΊπΈUnited States chrisolof
After posting I noticed the presence of the "Multiple entities" config option, and realized the prior patch could be improved by eliminating the canonical rerouting behavior (and hasMultiEntityPreviewLinks() checks) one level up when preview_link.settings:multiple_entities is FALSE. I think this will have a small performance benefit for sites that do not utilize multi-entity previews.
I have added the check to not redirect if the latest revision is published to patch #7 as that is what our content editors really want.
I've also included an extra patch rerolled for 2.1.0-alpha2 because the original one only works on the latest commits to the 2.1.x-dev branch and we prefer to use releases.
- Status changed to Needs work
9 months ago 11:07pm 1 April 2024 - π¦πΊAustralia acbramley
I think I like the combination of the configuration option + not redirecting if the latest revision is published.
Let's get this code into an MR, please do not include the multi entity stuff, that can come later if needed but let's keep this simple for now.
We also need tests.
The configuration can go into the new configuration UI as well.
- π¦πΊAustralia skipper-vp
I have rerolled the patch from #8 for Alpha3 version of the module.
I tested patch #8 and it's working. I can confirm that the user is no longer redirected to the preview link when accessing the content view page logged in!