Just noticed showMessage has a second parameter of $level = MigrationBase::MESSAGE_ERROR (i.e., it theoretically takes an integer constant), but what actually is passed in, at least in some cases, is a drupal_set_message/drush_log level string like 'error' or 'warning'. Need to review the message handling and make sure it's consistent, translating between error codes as necessary.

Comments

mikeryan’s picture

Status: Active » Fixed

OK, saveMessage consistently takes Migrate error codes (MigrationBase::MESSAGE_ERROR etc.) while showMessage consistently takes drupal_set_message/drush_log codes ('error' etc.). So, fixed the showMessage default to 'error' and changed the base implementation of saveMessage to translate before calling showMessage.

beholder’s picture

While node import I've got dump of the first node with 'error' level. First I thought there are some errors, but then I've found that everything is ok — it's just debug logging in the file plugins/sources/sql.inc (line 397):
$migration->showMessage(print_r($this->currentRow, TRUE));
I think that 'status' level will be better for user experience:
$migration->showMessage(print_r($this->currentRow, TRUE), 'status');

mikeryan’s picture

Status: Fixed » Active

Hah, should've run manual migrations as well as simpletests after that change... Actually, 'debug' is appropriate here.

mikeryan’s picture

Status: Active » Fixed

OK, fixed - this will only show when running with -d (--debug).

beholder’s picture

Status: Fixed » Active

I think that in file plugins/sources/csv.inc on the line 199 analogous situation. It should be:
$migration->showMessage(print_r($this->currentRow, TRUE), 'debug');
and so for plugins/sources/mssql.inc on line 267

mikeryan’s picture

Status: Active » Fixed

Thanks for catching that, fixed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.