Adding the bundles can be done in the entity info hook directly by using a database query instead of the load functions. I've changed it to an implementation that's a simpler version of how node.module does it.

#1440600: model_entity_info_alter() should not depend on Entity API helper functions. is a similar change, but didn't go as far as to remove the alter hook.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arvola’s picture

Assigned: arvola » Unassigned
Status: Active » Needs review
FileSize
1.82 KB
arvola’s picture

FileSize
1.82 KB

First patch had a whitespace error.

Anonymous’s picture

There is a mistake in your patch.
Look at

$return['contact']['bundles'][$type] = array(

should be
$return['model']['bundles'][$type] = array(

Anybody’s picture

Status: Needs review » Needs work

Confirming typo from #3. After fixing this the patch is working and good!
+1 for this. arvola could you upload a corrected patch?

vegantriathlete’s picture

Status: Needs work » Needs review
FileSize
608 bytes
1.96 KB

Looks like the file was missing the EOL character on the last line as well.