In migrate_ui_pages.inc and migrate.install, there are calls of getKeySchema as an instance method.
Since the getKeySchema is static, this code

$dest_key = $destination->getKeySchema();

should be replaced by something like that

$className = get_class($destination);
$dest_key = call_user_func(array($className, 'getKeySchema'));

Comments

Laurent Ren’s picture

I've just noticed that incompabilities may occur with some implementations of other modules, like EntityAPI which needs additional data (entity type).

It would be preferable to add the object instance as a argument of the function call.

mikeryan’s picture

Component: migrate_ui » Code
Category: bug » task
Status: Active » Postponed

Accessing a static method from a class instance is valid, and as you noticed necessary for the hacky entity_api destination handler. The entity_api use case is something we didn't anticipate initially but makes sense - the next (V3) version of the Migrate API should accommodate this. Note that the use of the instance was actually introduced to support entity_api.

pifagor’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)