Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293630

Update MigrateDestinationInterface::import return type documentation.

$
0
0

Problem/Motivation

The current doc block for MigrateDestinationInterface::import()'s return value reads:

   * @return mixed
   *   The entity ID or an indication of success.
   */

This is is incorrect. The return value should be array|bool. The method should return an array of destination ids indexed in the same order as they are defined in MigrateDestinationInterface::getIds() to save the ids to the idmap, or TRUE to report success and not save IDs to the idmap (such as for configs) or FALSE to indicate an error.

There is no situation where the plugin would return a scalar entity id as it would throw an error when the idmap attempted to iterate over it. It is also impropert to assume that a destination is even saving an entity, we shouldn't make any assumptions about what the destination plugin is doing.

All core plugins already have return values that meet this criteria.

Proposed resolution

Update the documentation to be clear.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293630

Trending Articles