Don't reset count if redirect goes to the same place

Created on 23 August 2021, over 3 years ago
Updated 20 May 2025, about 5 hours ago

Problem/Motivation

The redirect count is reset to zero if there is a change in the redirect hash, even if the change doesn't actually change where the redirect goes.

Steps to reproduce

1. On a site with friendly URLs, create a page titled "Test Shortcut Count" which gets saved with the friendly URL "test-shortcut-count"
2. Use /admin/config/search/redirect/add to add a shortcut from "shortcutcount" to "test-shortcut-count"
3. Visit /admin/config/search/redirect/list/shortcutcount

Actual and desired: Count is 0

4. On a separate browser, visit "shortcutcount" (it's okay that they get a 403 status code)
5. Refresh /admin/config/search/redirect/list/shortcutcount

Actual and desired: Count is 1

6. Edit the shortcut to change the from field from "shortcutcount" (all lower case) to "ShortcutCount" (capital s, lowercase ortcut, capital c, lowercase ount)
7. Click Save

Desired: Count remains 1
Actual: Count is 0

8. On a separate browser, visit "shortcutcount" (it's okay that they get a 403 status code)
9. Refresh /admin/config/search/redirect/list/shortcutcount

Desired: Count is 2
Actual: Count is 1

10. Edit the shortcut to change the to field from "test-shortcut-count" (all lower case) to "node/" followed by the node number

Desired: Count remains 2

Proposed resolution

Option 1: Detect whether the change in the redirect has no change in where the destination goes and, if so, don't reset the count
Option 2: If the count would be reset to zero, ask whether the user wants the count to be reset to zero
Option 3: In the Redirect configuration, provide an option to defeat reset to zero on change

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

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