Redirects deleted too early

Created on 6 January 2012, almost 13 years ago
Updated 1 July 2024, 5 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

RTBC

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 about 1 year 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.

  • Status changed to RTBC 5 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 7.x + Environment: PHP 5.6 & MySQL 5.5
    last update 5 months ago
    11 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 7.x + Environment: PHP 5.6 & MySQL 5.5
    last update 5 months ago
    Patch Failed to Apply
  • I applied the patch in #73 on 7.x-1.x-dev some days ago and the issue seems to be solved, thanks!

Production build 0.71.5 2024