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

Fatal error in CommentEntityTranslation @MigrationSource when source site does not have comment module installed

$
0
0

Problem/Motivation

This is a problem similar to that in #2859315: SQL error from profile_fields when migrating d6 (or d7) to d8 without Profile module. It was introduced in #2981000: Migrate Drupal 7 comment entity translations data to Drupal 8.

Steps to reproduce

Drupal 7 site without comment module.

Drupal 8|9 site with comment module and content_translation module.

Attempting to load the list of migrations results in the following fatal error:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.comment' doesn't exist: SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM {entity_translation} "et" INNER JOIN {comment} "c" ON c.cid = et.entity_id INNER JOIN {node} "n" ON n.nid = c.nid WHERE ("et"."entity_type" = :db_condition_placeholder_0) AND ("et"."source"<> :db_condition_placeholder_1)) "subquery"; Array ( [:db_condition_placeholder_0] => comment [:db_condition_placeholder_1] => ) in Drupal\migrate\Plugin\migrate\source\SqlBase->doCount() (line 389 of core/modules/migrate/src/Plugin/migrate/source/SqlBase.php).
Drupal\Core\Database\Statement->execute(Array, Array) (Line: 740)
Drupal\Core\Database\Connection->query('SELECT COUNT(*) AS "expression"
FROM
(SELECT 1 AS "expression"
FROM
{entity_translation} "et"
INNER JOIN {comment} "c" ON c.cid = et.entity_id
INNER JOIN {node} "n" ON n.nid = c.nid
WHERE ("et"."entity_type" = :db_condition_placeholder_0) AND ("et"."source"&lt;&gt; :db_condition_placeholder_1)) "subquery"', Array, Array) (Line: 91)
Drupal\Core\Database\Driver\mysql\Connection->query('SELECT COUNT(*) AS "expression"
FROM
(SELECT 1 AS "expression"
FROM
{entity_translation} "et"
INNER JOIN {comment} "c" ON c.cid = et.entity_id
INNER JOIN {node} "n" ON n.nid = c.nid
WHERE ("et"."entity_type" = :db_condition_placeholder_0) AND ("et"."source"&lt;&gt; :db_condition_placeholder_1)) "subquery"', Array, Array) (Line: 510)
Drupal\Core\Database\Query\Select->execute() (Line: 389)

Proposed resolution

Add CommentEntityTranslation::checkRequirements() similar to #2859315: SQL error from profile_fields when migrating d6 (or d7) to d8 without Profile module.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.


Viewing all articles
Browse latest Browse all 295544