I'm declaring an entity that's using EntityAPIController.
I'm also declaring all of my properties in $module.info.inc.
However, entity_entity_property_info() has this code
// Add in info about entities provided by the CRUD API.
foreach (entity_crud_get_info() as $type => $info) {
$info += array('metadata controller class' => 'EntityDefaultMetadataController');
if ($info['metadata controller class']) {
$controller = new $info['metadata controller class']($type);
$items += $controller->entityPropertyInfo();
}
}
So it's auto-generating the properties even though I'm providing them myself.
So for every property I get duplicate data in the array (for example, 'type' => 'integer' becomes 'type' => array('integer', 'integer')), which breaks everything.
I specified 'metadata controller class' => '' in my entity info and that fixed it, but I think the code should be less forceful about doing its own thing.
So, maybe we can add a check to see if the module already provides property info?
Comment | File | Size | Author |
---|---|---|---|
#4 | entity_info_controller.patch | 905 bytes | fago |
Comments
Comment #1
wesnick CreditAttribution: wesnick commentedsubscribe
Comment #2
fagoUsually, I've just overridden the default controller and work on top of the defaults. But well, the defaults aren't so super-useful anyway.
>So, maybe we can add a check to see if the module already provides property info?
Sounds good, patch welcome ;)
Comment #3
fagoI guess, best we just check whether the module implements the hook itself.
Comment #4
fagoso what about that?
Comment #5
bojanz CreditAttribution: bojanz commentedSounds good.
Comment #6
fagoCommitted.