Every redirect is now disabled after upgrade - enabled toggled off for all redirects

Created on 5 September 2025, about 1 month ago

Problem/Motivation

I updated the module today because the patch for wildcards was preventing me from deploying my website. I removed the patch and upgraded to 8.x-1.12. I got a new site error telling me I had an entity mismatch, so I ran devel "entup" on production (then turned off devel). I got reports that redirects weren't working. After investigating, it appears there is an "Enabled" field now. I'm not certain, but I think there are 1000s of redirects that are now disabled because they are all toggled off. The default should have been "1" and not "0" because it's breaking our navigation.

Please correct me if I'm wrong.

Steps to reproduce

Drupal 10.5.x site with existing redirects. Upgrade the module to the latest version. Run entity updates using devel (which adds the Enabled field). Look at an existing redirect. The checkbox for Enabled is presumable toggled off and therefore the redirect isn't working.

Proposed resolution

Change the default to 1, not 0, or remove this feature.

Remaining tasks

...

User interface changes

...

API changes

...

Data model changes

...

πŸ› Bug report
Status

Active

Version

1.12

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rraney

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

Comments & Activities

  • Issue created by @rraney
  • πŸ‡ΊπŸ‡ΈUnited States rraney
  • πŸ‡ΊπŸ‡ΈUnited States rraney

    Downgrade to 1.11 resolved my issue for the time being. I'm still curious if something can be done to make sure these fields are turned on, rather than off.

  • I also have problems after updating to 1.12

    Drupal\Core\Entity\Query\QueryException: 'enabled' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 369 of core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).

    and

    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'enabled' in 'where clause': SELECT "base_table"."rid" AS "rid", "base_table"."rid" AS "base_table_rid" FROM "redirect" "base_table" INNER JOIN "redirect" "redirect" ON "redirect"."rid" = "base_table"."rid" WHERE ("redirect"."redirect_redirect__uri" IN (:db_condition_placeholder_0, :db_condition_placeholder_1)) AND (""."enabled" = :db_condition_placeholder_2); Array ( [:db_condition_placeholder_0] => internal:/node/1409 [:db_condition_placeholder_1] => entity:node/1409 [:db_condition_placeholder_2] => 1 ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 272 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

    Going back to 1.11 seems to fix the problem

  • πŸ‡·πŸ‡΄Romania amateescu

    @rraney, this feature was introduced in ✨ Add back 'disabled' redirects Active , and, as can be seen from the code, the 'Enabled' field is TRUE by default. Maybe you have some custom code around redirects that disable it for some reason?

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

    What's the solution to this message when installing 12? I think this must be related to my issue.

    Mismatched entity and/or field definitions
    The following changes were detected in the entity type and field definitions.
    Redirect
    The Enabled field needs to be installed.

    Locally, when I run `drush entup` using Devel, it says the field needs to be installed. I had to do this in production by enabling Devel and running the command. Once I run this command, the "Enabled" checkbox is not checked for any of my redirects.

    Your suggestion is that I have custom code around redirects. I'm unaware of any and don't know how I would find this. Any thoughts?

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

    Even after running "drush entup", I get this message:

    Mismatched entity and/or field definitions
    The following changes were detected in the entity type and field definitions.
    Redirect
    The Redirect entity type needs to be updated.

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

    In SqlContentEntityStorage.php line 866:

    SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'enabled' cannot be null: INSERT INTO "tmp_d4277credirect" ("rid", "type", "uuid", "language", "enabled", "hash", "uid",
    "redirect_source__path", "redirect_source__query", "redirect_redirect__uri", "redirect_redirect__title", "redirect_redirect__options", "status_code", "created") VALUES (:db_insert_pl
    aceholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_pl
    aceholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array
    (
    [:db_insert_placeholder_0] => 2182
    [:db_insert_placeholder_1] => redirect
    [:db_insert_placeholder_2] => cea28385-f8a3-4904-85b9-a23735b04c95
    [:db_insert_placeholder_3] => und
    [:db_insert_placeholder_4] =>
    [:db_insert_placeholder_5] => 44QZOQoTxNZCCmWu9wsh4diJClT4DZVLPIC4rmt-CCQ
    [:db_insert_placeholder_6] => 0
    [:db_insert_placeholder_7] => depts/sheriff/services/adult-corrections-(county-jail)
    [:db_insert_placeholder_8] => N;
    [:db_insert_placeholder_9] => http://www.dgso.org/index.php?option=com_content&view=article&id=28&Item...
    [:db_insert_placeholder_10] =>
    [:db_insert_placeholder_11] => a:0:{}
    [:db_insert_placeholder_12] => 301
    [:db_insert_placeholder_13] => 1673032491
    )

    In ExceptionHandler.php line 45:

    SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'enabled' cannot be null: INSERT INTO "tmp_d4277credirect" ("rid", "type", "uuid", "language", "enabled", "hash", "uid",
    "redirect_source__path", "redirect_source__query", "redirect_redirect__uri", "redirect_redirect__title", "redirect_redirect__options", "status_code", "created") VALUES (:db_insert_pl
    aceholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_pl
    aceholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array
    (
    [:db_insert_placeholder_0] => 2182
    [:db_insert_placeholder_1] => redirect
    [:db_insert_placeholder_2] => cea28385-f8a3-4904-85b9-a23735b04c95
    [:db_insert_placeholder_3] => und
    [:db_insert_placeholder_4] =>
    [:db_insert_placeholder_5] => 44QZOQoTxNZCCmWu9wsh4diJClT4DZVLPIC4rmt-CCQ
    [:db_insert_placeholder_6] => 0
    [:db_insert_placeholder_7] => depts/sheriff/services/adult-corrections-(county-jail)
    [:db_insert_placeholder_8] => N;
    [:db_insert_placeholder_9] => http://www.dgso.org/index.php?option=com_content&view=article&id=28&Item...
    [:db_insert_placeholder_10] =>
    [:db_insert_placeholder_11] => a:0:{}
    [:db_insert_placeholder_12] => 301
    [:db_insert_placeholder_13] => 1673032491
    )

    In StatementWrapperIterator.php line 113:

    SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'enabled' cannot be null

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

    In SqlFieldableEntityTypeListenerTrait.php line 220:

    The entity update process failed while processing the entity type redirect, ID: 2182.

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

    Here's the structure shown for this field in the redirect table in PHPMyAdmin

    14 enabled tinyint Yes NULL

    Should NULL be "Yes"?

  • πŸ‡©πŸ‡ͺGermany mkress Germany

    exactly the same issue for me, when editing an existing node.

  • πŸ‡·πŸ‡΄Romania amateescu

    @rraney, is there any reason for using drush entup instead of drush updb?

    @mkress, can you provide a bit more details?

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

    Hello, drush updb didn't do anything when I tried that. Then I saw the "mismatched" error. When I see this, I naturally think I need to try doing the entity update.

Production build 0.71.5 2024