Problem/Motivation

When visiting "/admin/config/search/path" after migrating from Drupal 7, I see that "/donate" should be rewritten to "/civicrm/contribute/transact?reset=1&id=14", but it using "/donate" always loads an admin interface, even though entering the target / system path manually leads to the correct destination.

I believe that this is related to, but distinct from, , because in this case, query parameters are not being copied from the source to the destination, but it's more of a string substitution that was working with the `alias` module on Drupal 7.

I also noticed that for entries with query parameters in the target URL, that the "/donate" link on the aliases admin page links directly to the target URL rather than "/donate" itself, and the target URL to the right of it links to a version that contains escaped code: "/civicrm/contribute/transact%3Freset%3D1%26id%3D14", which my browser rewrites as the correct URL when I follow it.

Entries that don't use query parameters in the target URL don't have that admin interface behavior either.

The following entries in the database look good to me. I tried changing the langcode from "und" to "en", but that didn't help.

MariaDB [drupal]> select * from path_alias where id = "588";
+-----+-------------+--------------------------------------+----------+--------------------------------------------+---------+--------+
| id  | revision_id | uuid                                 | langcode | path                                       | alias   | status |
+-----+-------------+--------------------------------------+----------+--------------------------------------------+---------+--------+
| 588 |         569 | baafe555-9d95-4dfa-86d5-7c2ba5a7e502 | en       | /civicrm/contribute/transact?reset=1&id=14 | /donate |      1 |
+-----+-------------+--------------------------------------+----------+--------------------------------------------+---------+--------+
1 row in set (0.002 sec)

MariaDB [drupal]> select * from path_alias_revision where id = "588";
+-----+-------------+----------+--------------------------------------------+---------+--------+------------------+
| id  | revision_id | langcode | path                                       | alias   | status | revision_default |
+-----+-------------+----------+--------------------------------------------+---------+--------+------------------+
| 588 |         569 | en       | /civicrm/contribute/transact?reset=1&id=14 | /donate |      1 |                1 |
+-----+-------------+----------+--------------------------------------------+---------+--------+------------------+
1 row in set (0.001 sec)

Steps to reproduce

1. Create a CiviCRM site, or a site that supports query parameters in URLs
2. Create a new alias with the system path set to "/civicrm/contribute/transact?reset=1&id=1", and the URL alias set to "/foo".
3. Visit https://{example.com}/foo
4. You don't see the desired page, but a page like "/civicrm/contribute?reset=1", with the URL bar showing "/donate"

Proposed resolution

I don't know the solution or the bug, but I suspect that there is an issue in the code regarding escaping of URLs and dereferencing of aliases.

Remaining tasks

  • Fix handling of redirects / aliases that have system paths that contain query parameters
  • Fix the dereferencing and escaping of URLs in the admin interface for entries with system paths that contain query parameters

User interface changes

Fix dereferencing and escaping of URLs on admin page

API changes

None

Data model changes

None

Comments

eeprom created an issue.