Closed (outdated)
Project:
Migrate
Version:
7.x-2.5
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Apr 2013 at 08:59 UTC
Updated:
21 Feb 2018 at 13:45 UTC
Jump to comment: Most recent
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
Comment #1
Laurent Ren commentedI'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.
Comment #2
mikeryanAccessing 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.
Comment #3
pifagor commented