Redirects deleted too early

Created on 6 January 2012, over 12 years ago
Updated 1 November 2023, 8 months ago

Postponed on #1853144: Store created date/time β†’ .

Problem/Motivation

When the option 'Delete redirects that have not been accessed for' is not set to 'Never', manually created redirects are deleted on the next cron run. This is because during cron 'inactive' redirects are cleaned up. This are redirects that haven't been accessed for a defined period of time. Just created redirects have never been accessed, so they are removed because the value for 'access' is 0.

Proposed resolution

Keep track of when a redirect is created. When purging inactive redirects, besides checking if they haven't been accessed for some time, also check if they haven't been created recently. The patch for adding the 'created' column is in #1853144: Store created date/time β†’ .

Remaining tasks

User interface changes

On the overview page of redirects, a column 'Created' is added.

API changes

None.

Data model changes

A column called 'created' is added to the redirect table.

Original report by danst0

Hi,

I just installed the Redirect module and added several redirects which were in the .htaccess before.
After adding some stuff, Redirect just deleted a bunch of them (not all but most).
I have the auto deletion set to six month.
I think the screenshots show what I mean...

Did I do something wrong?

Daniel

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany danst0

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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 7.x + Environment: PHP 5.6 & MySQL 5.5
    last update 9 months ago
    12 pass
  • πŸ‡³πŸ‡±Netherlands ralphvdhoudt

    Updated patch #67 to the latest code and added a check if the created column does not exists yet before adding it

  • πŸ‡ΊπŸ‡ΈUnited States vchen

    Tried patch #73. It seemed to have fixed the problem at first. It passed multiple tests on different environments including prod, but then it happened again.

    In my redirect settings, I have it to Delete redirects that have not been accessed for 1 yr and delete a max of 10 redirects per cron run.

    The patch was applied, cleared cache, updated the db, which applied the db updates (Redirect 7105 Adds the {redirect}.created field.).

    When I ran cron manually via drush, the redirects with count = 0 stayed.

    When the cron ran automatically as scheduled, the redirects with count = 0 are gone again.

  • πŸ‡³πŸ‡΄Norway steinmb

    We always roll patches against dev. to make sure it safely can be applied and works with the latest changes.

Production build 0.69.0 2024