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
Comment #1
mikeryanOK, 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.
Comment #2
beholder commentedWhile 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');Comment #3
mikeryanHah, should've run manual migrations as well as simpletests after that change... Actually, 'debug' is appropriate here.
Comment #4
mikeryanOK, fixed - this will only show when running with -d (--debug).
Comment #5
beholder commentedI think that in file
plugins/sources/csv.incon the line 199 analogous situation. It should be:$migration->showMessage(print_r($this->currentRow, TRUE), 'debug');and so for
plugins/sources/mssql.incon line 267Comment #6
mikeryanThanks for catching that, fixed!