In subsite setup view_path is not correct for links on AJAX page refresh

Created on 24 April 2020, over 4 years ago
Updated 2 June 2023, over 1 year ago

When you run Drupal in a sub-directory, the destination parameter that gets added to (edit) links inside a View is missing the base path and the language prefix after an AJAX reload.

Steps to verify.

  • Create a subsite setup with name "subsite" so paths are like www.example.com/subsite/*
  • Create a view with content listing and a column for Content: Operations links
  • Also expose some filter like content type
  • Enable Use AJAX under Adavanced > Other
  • Visit the newly created view
  • On initial load, while hovering on Edit, you will see the destination url has "/subsite" as prefix
  • Apply one of the exposed filters, like content type
  • Now on hovering Edit, you won't see destination url has a prefix "/subsite"
  • If you continue and edit the node and directly save the node, site breaks with untrusted url, because the prefix '"/subsite" is missing

Error message related to this problem as described:

Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.

The error is caused by views not properly replacing the destination parameters with the expected prefix. The patch number 2 fixes this problem.

🐛 Bug report
Status

Closed: duplicate

Version

11.0 🔥

Component
Views 

Last updated about 1 hour ago

Created by

🇮🇳India anup.singh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024