Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | model-remove-entity-info-alter-2225895-5.patch | 1.96 KB | vegantriathlete |
#5 | interdiff.2-5.txt | 608 bytes | vegantriathlete |
#2 | model-remove-entity-info-alter-2225895-2.patch | 1.82 KB | arvola |
Comments
Comment #1
arvola CreditAttribution: arvola commentedComment #2
arvola CreditAttribution: arvola commentedFirst patch had a whitespace error.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedThere is a mistake in your patch.
Look at
should be
$return['model']['bundles'][$type] = array(
Comment #4
AnybodyConfirming typo from #3. After fixing this the patch is working and good!
+1 for this. arvola could you upload a corrected patch?
Comment #5
vegantriathleteLooks like the file was missing the EOL character on the last line as well.