- Issue created by @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 ofdrush 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.