Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295994

taxonomy_post_update_make_taxonomy_term_revisionable() fails when terms have no default translation

$
0
0

Problem/Motivation

taxonomy_post_update_make_taxonomy_term_revisionable() fails if a term name is null. This isn't enforced by the 8.6.x schema and it looks like potentially devel generate can create terms like this (going from reports below, not reproduced).

We should either default to an empty string, or do the same thing we did on #3052147: comment_update_8701 fails if there are comments without field_name and prevent the update if this condition is found.

From #3052464: Cannot update to 8.7.0 because of taxonomy_post_update_make_taxonomy_term_revisionable OP

Update started: taxonomy_post_update_make_taxonomy_term_revisionable
>  [error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null: INSERT INTO {tmp_d305d9taxonomy_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] => tr
>     [: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 /var/www/drupal8/web/core/lib/Drupal/Core/Database/Connection.php).
>  [error]  The entity update process failed while processing the entity type taxonomy_term, ID: 1.
>  [error]  Update failed: taxonomy_post_update_make_taxonomy_term_revisionable
 [error]  Update aborted by: taxonomy_post_update_make_taxonomy_term_revisionable
 [error]  Finished performing updates.

And from #3052464-53: Cannot update to 8.7.0 because of taxonomy_post_update_make_taxonomy_term_revisionable

I had this problem and try infinite ways to solve it. I try updating core first and the problem appear. I revert to 8.6.1 and the error was not there. I updated everything I could before retrying updating to 8.7.1. I even learn and did a composer installation and the error still appear.

The I read the #13 comment and check my db and found some Devel Generated Taxonomy terms. I couldn't delete it via phpMyAdmin because everything broke. So I did a fresh reinstall of 8.6.1 version and created a view for taxonomy terms showing ID.

I found the two terms with id but without name. I try to delete the via Views Bulks Operation but it didn't react to delete operation. So I went directly to the term via url and I after I open the term, that was completely empty, I delete them inside edit.

After that I try the core update without any problem, event though the db update gave a message, it was purely informative. The taxonomy terms where now revisionable.

And schema from an 8.6.x database:

MariaDB [aftlms]> DESCRIBE taxonomy_term_field_data;
+---------------------+------------------+------+-----+---------+-------+
| Field               | Type             | Null | Key | Default | Extra |
+---------------------+------------------+------+-----+---------+-------+
| tid                 | int(10) unsigned | NO   | PRI | NULL    |       |
| vid                 | varchar(32)      | NO   | MUL | NULL    |       |
| langcode            | varchar(12)      | NO   | PRI | NULL    |       |
| name                | varchar(255)     | NO   | MUL | NULL    |       |
| description__value  | longtext         | YES  |     | NULL    |       |
| description__format | varchar(255)     | YES  |     | NULL    |       |
| weight              | int(11)          | NO   |     | NULL    |       |
| changed             | int(11)          | YES  |     | NULL    |       |
| default_langcode    | tinyint(4)       | NO   |     | NULL    |       |
| status              | tinyint(4)       | NO   | MUL | NULL    |       |
+---------------------+------------------+------+-----+---------+-------+

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 295994

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>