When I navigate to the Messages tab on a migration that has no messages I get the following error message in the drupal_messages section. I realize this is not a common way to get to the messages, but it still is a legitimate path. I believe it's a minor coding error.

Notice: Undefined index: description in migrate_ui_messages() (line 1539 of /home/spe2sp/public_html/sites/all/modules/migrate/migrate_ui/migrate_ui.pages.inc).

Comments

pcher1bw’s picture

Steps to reproduce.

On a successfully completed migration click on the task name to review the sources and destination. Then click on the MESSAGES tab in the upper right hand corner of the UI.

mikeryan’s picture

Category: Bug report » Support request

That's a notice, not an error.

The description in question is the one that should be on your MigrateSQLMap source schema definition, e.g.:

    $this->map = new MigrateSQLMap($this->machineName,
      array(
        'style' => array('type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'description' => 'Topic ID',
        )
      ),
      MigrateDestinationTerm::getKeySchema()
    );

You should provide a description on your source key column, so the messages tab will have a header for the table column.

pcher1bw’s picture

Status: Active » Closed (fixed)

Sorry for bothering you with another user error.

daniroyo’s picture

Great, thanks for you help Mike, I had the same problem, I think It was not neccesary this param before 2.6.

mambotech’s picture

Hi,

I have the following in my class but I am getting this error.

PHP Fatal error: Call to undefined method MigrateFieldMapping::getXpath() in /var/www/spn/sites/all/modules/migrate/plugins/sources/xml.inc on line 368
PHP Stack trace:
PHP 1. {main}() /usr/share/drush/drush.php:0
PHP 2. drush_main() /usr/share/drush/drush.php:14
PHP 3. _drush_bootstrap_and_dispatch() /usr/share/drush/drush.php:59
PHP 4. drush_dispatch() /usr/share/drush/drush.php:90
PHP 5. call_user_func_array:{/usr/share/drush/includes/command.inc:165}() /usr/share/drush/includes/command.inc:165
PHP 6. drush_command() /usr/share/drush/includes/command.inc:165
PHP 7. _drush_invoke_hooks() /usr/share/drush/includes/command.inc:198
PHP 8. call_user_func_array:{/usr/share/drush/includes/command.inc:324}() /usr/share/drush/includes/command.inc:324
PHP 9. drush_migrate_import() /usr/share/drush/includes/command.inc:324
PHP 10. MigrationBase->processImport() /var/www/spn/sites/all/modules/migrate/migrate.drush.inc:1221
PHP 11. Migration->import() /var/www/spn/sites/all/modules/migrate/includes/base.inc:1073
PHP 12. XMLMigration->applyMappings() /var/www/spn/sites/all/modules/migrate/includes/migration.inc:709
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined method MigrateFieldMapping::getXpath() in
/var/www/spn/sites/all/modules/migrate/plugins/sources/xml.inc, line 368


/**
 * @file perla.inc
 * XML import from La Perla.
 */

/**
 * XML import from La Perla Class.
 */
class LaPerlaxmlimport extends XMLMigration {
  public function __construct($arguments) {
    parent::__construct($arguments);
    $this->description = t('XML feed of La Perla Properties.');

    // There isn't a consistent way to automatically identify appropriate
    // "fields" from an XML feed, so we pass an explicit list of source fields.

    $source_fields = array(
      'lang_type' => t('Language'),
      'field_ref_remote' => t('Ref'),
      'field_location_prop_remote' => t('Location'),
      'title_remote' => t('Title'),
      'field_price_remote' => t('Price'),
      'field_status_remote' => t('Status'),
      'field_listing_type_remote' => t('Listing Type'),
      'field_property_type_remote' => t('Property Type'),
      'field_cee_epc_remote' => t('CEE/EPC'),
      'field_bedrooms_remote' => t('Bedrooms'),
      'field_bathrooms_remote' => t('Bathrooms'),
      'field_sq_ft_remote' => t('Dwelling Size'),
      'field_lot_size_remote' => t('Plot Size'),
      'field_interior_features_remote' => t('Home Features'),
      'body_remote' => t('Description'),
      'field_image_remote' => t('Property Photos'),
    );

    $items_url = 'http://xml2u.com/Xml/La%20Perla%20estates_1426/4244_Default.xml';
    $item_xpath = '/document/Clients/Client/properties/Property';
    $item_ID_xpath = 'propertyid';

    $items_class = new MigrateItemsXML($items_url, $item_xpath, $item_ID_xpath);
    $this->source = new MigrateSourceMultiItems($items_class, $source_fields);
    $this->destination = new MigrateDestinationNode('property');

    // The source ID here is the one retrieved from the XML listing URL, and
    // used to identify the specific item's URL.
    // $sourceid = '/document/FileDetails/orderName/';
    // $sourceid = 'myspace';
    $source_key = array(
      'bar' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
		'description' => 'Title',
      ),
    );
    $this->map = new MigrateSQLMap($this->machineName, $source_key, MigrateDestinationRole::getKeySchema());

    // TIP: Note that for XML sources, in addition to the source field passed to
    // addFieldMapping (the name under which it will be saved in the data row
    // passed through the migration process) we specify the Xpath used to retrieve
    // the value from the XML.
    //$this->addFieldMapping('title', 'title_remote')
     // ->defaultValue('Foobar');

     //$this->addFieldMapping('field_ref', 'field_ref_remote')
     //  ->xpath('/document/Clients/Client/properties/Property/reference');

    // $this->addFieldMapping('field_location_prop', 'field_location_prop_remote')
    //   ->xpath('/document/Clients/Client/properties/Property/Address/location');

    $this->addFieldMapping('title', 'title_remote')
      ->xpath('title');
<?php