Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello !
Each time I tried to migrate comments, I got an error message saying that table comment could not be found. The error was supposed to be situated in database.inc ...
Instead, I discovered that if it search table comment, instead of table prefix_comment, it was because of some pairs of forgotten brackets.
So in plugins/destination/comment.inc, on line 225, you'll have to do add them twice (after each FROM), and get then :
$sql = "
INSERT IGNORE INTO {node_comment_statistics} (nid, cid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) (
SELECT c.nid, c.cid, c.created, c.name, c.uid, c2.comment_count FROM {comment} c
JOIN (
SELECT c.nid, MAX(c.created) AS created, COUNT(*) AS comment_count FROM {comment} c WHERE status=:published GROUP BY c.nid
) AS c2 ON c.nid = c2.nid AND c.created=c2.created
)";
Have a nice day !
Comments
Comment #1
mikeryanComment #2
mikeryanCommitted, thanks!