Hi all, I have this class:

    class MigrateMhtNotizieCommentiMigration extends MigrateMhtAbstractCommentMigration {
      public function __construct() {
        $arguments = array();
        $arguments['whr'] = 3;
        $arguments['wid'] = 172
        $arguments['commentCT'] = 'comment_node_notizie';
        $arguments['migrateFrom'] = 'MigrateMhtNotizie';
        parent::__construct($arguments);
      }
    }

In this (little) class I want to import only "comments" form my "notizie" with id = 172.

At "admin/content/migrate" page I see that migrate calculate 2 rows to import, and this is correct.

MIGRATION: MigrateMhtNotizieCommenti
TOTAL ROWS : 2
IMPORTED: 0
UNIMPORTED : 2

I "import" the MigrateMhtNotizieCommenti's migrate and I see this message:

Processed 2 (2 created, 0 updated, 0 failed, 0 ignored) in 0 sec (6939/min) - done with 'MigrateMhtNotizieCommenti'

And it's correct, and if I see the notizie's node I see 2 comments. All ok.

But in the summary page I read:

MIGRATION: MigrateMhtNotizieCommenti
TOTAL ROWS : 2
IMPORTED: 1
UNIMPORTED : 1

Why ?

Comments

mikeryan’s picture

Component: migrate_ui » Code
Status: Active » Postponed (maintainer needs more info)

Good question - please look at the migrate_map_migratemhtnotiziecommenti table, in particular at the "needs_update" column. It sounds like one of the rows in there will have a value of 2 (MigrateMap::STATUS_IGNORED), although it's weird that the comment would still actually be imported. Unless perhaps your MigrateMhtNotizieCommentiMigration has a prepareRow() that is not checking the value returned by parent::prepareRow, and the parent is trying to ignore the orw?

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further information provided.