Latest version of Redirect module failed to run updates.

Created on 29 August 2025, 11 days ago

So I updated two sites with the latest version of redirect 1.12 the first site when running drush updb had an update that processed for redirect - I am assuming it was to update all the existing redirects to use the new "Enabled" boolean, because when I updated the second site with the latest redirect module and then tried to run drush updb after there were no pending updates; having seen one on the previous site I was expecting the same on the second.

If I inspect any redirects on the second site every single one has an unchecked enable setting (so I guess now they are all disabled) which is unfortunate because there are hundreds if not thousands on that site. If I look at the redirects on the first site that was updated they all have the new "Enable" field checked.

I have no idea why one site would run database updates properly and then not update on the other, they are both running latest Drupal 10 (10.5.2), MySQL 8.4.3, PHP 8.3.15, Drush 12.5.3.0 and Composer 2.8.4

In regards to that new feature, I have to say I think that entire feature was done backwards - and counterintuitive to how the module originally handles redirect entries. Should it not have been a "Disabled" field boolean added as the new option instead, this way no existing redirects would need to be updated risking catastrophe and failures? Then it would have been a simple check it to disable it.

For now I'll just have to downgrade back to version 1.11 of redirect on the second site at least until I can dig into this further.

πŸ› Bug report
Status

Active

Version

1.12

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States sidgrafix

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

Comments & Activities

  • Issue created by @sidgrafix
  • πŸ‡·πŸ‡΄Romania amateescu

    The most likely problem is that on your second site you had a patch applied that provided an update function with the number 8110, so Drupal didn't run redirect_update_8110() again (the function which adds the 'enabled' field). You can fix this situation quite easily by running this Drush command:

    drush php:eval "\Drupal::service('update.update_hook_registry')->setInstalledVersion('redirect', 8109);"
    

    That will make Drupal aware that the last update function that ran for the Redirect module is redirect_update_8109(), so it will correctly pick up and execute redirect_update_8110() when you run the database updates.

    In regards to that new feature, I have to say I think that entire feature was done backwards - and counterintuitive to how the module originally handles redirect entries. Should it not have been a "Disabled" field boolean added as the new option instead, this way no existing redirects would need to be updated risking catastrophe and failures? Then it would have been a simple check it to disable it.

    This assessment is incorrect, the new enabled field is set to TRUE by default, which means you don't have to update any existing redirects, and there's no behavior change for new ones as well.

  • πŸ‡¬πŸ‡§United Kingdom bmango

    Thanks so much @amateescu, this worked for me and I was able to run the update.

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

    @amateescu indeed that worked, thank you.. Tho I still disagree with the manner of implementation. Adding a "Disabled" field and not requiring the update of hundreds if not thousands of redirects (as in my case) would have been the better, safer path.

Production build 0.71.5 2024