【发布时间】:2019-10-03 16:00:44
【问题描述】:
运行composer update drupal/core webflo/drupal-core-require-dev --with-dependencies更新到v8.7.1后,再运行drush updb,这里更新失败:
[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable [4.77 sec, 33.46 MB]
[error] Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null: INSERT INTO {tmp_b3edd9taxonomy_term_field_data} (tid, revision_id, vid, langcode, name, description__value, description__format, weight, changed, default_langcode, status, revision_translation_affected) VALUES (:db_insert_placeholder_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_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11);
Array
(
[:db_insert_placeholder_0] => 1
[:db_insert_placeholder_1] => 1
[:db_insert_placeholder_2] => tags
[:db_insert_placeholder_3] => zxx
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] =>
[:db_insert_placeholder_6] =>
[:db_insert_placeholder_7] =>
[:db_insert_placeholder_8] =>
[:db_insert_placeholder_9] =>
[:db_insert_placeholder_10] =>
[:db_insert_placeholder_11] => 1
)
in Drupal\Core\Database\Connection->handleQueryException() (line 689 of /mnt/www/html/optivode42/docroot/core/lib/Drupal/Core/Database/Connection.php). [7.12 sec, 45.21 MB]
[error] The entity update process failed while processing the entity type taxonomy_term, ID: 1. [8.17 sec, 45.24 MB]
[error] Update failed: taxonomy_post_update_make_taxonomy_term_revisionable [8.17 sec, 38.9 MB]
其他解决方案在 taxonomy_term_field_data 字段中显示错误数据,但这似乎不是问题所在。
我检查了taxonomy_term_field_data,没有name为NULL的记录,我什至没有任何带有langcodezxx的记录,所以我现在有点不知所措。似乎没有什么我可以删除来解决这个问题,就像其他答案一样。
*编辑:我在 taxonomy_term_data 中有 langcode zxx 记录,所以我删除了这些记录,我得到了同样的错误,但是:
Array
(
[:db_insert_placeholder_0] => 2
[:db_insert_placeholder_1] => 2
[:db_insert_placeholder_2] => tags
[:db_insert_placeholder_3] => en
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] =>
[:db_insert_placeholder_6] =>
[:db_insert_placeholder_7] =>
[:db_insert_placeholder_8] =>
[:db_insert_placeholder_9] =>
[:db_insert_placeholder_10] =>
[:db_insert_placeholder_11] => 1
)
【问题讨论】: