(This is a duplicate of relation module issue #2915180: During install: PHP Fatal error: Call to a member function fieldExtraFields() on boolean but there could be a chance that this can be fixed to entity module instead so I'm opening this one here too. There is a patch in relation issue that is working around the static cache.)

This came up years ago in a closed issue #1936206: Relation install fails to add endpoint field to types provided by the defaults hook and for quite a long time I though #1891356: D7: Reset drupal static caches when a module is enabled or disabled. already fixed this issue. Now I've managed to reproduce the same issue with that core patch applied.

I had a feature module that had relation type in it and then I installed the group module. If by chance the group module got enable first its extra fields controller was wrong in static cache and when relation_type_ensure_instance() starts doing its thing the bad static cache throws fatal error PHP Fatal error: Call to a member function fieldExtraFields() on boolean in /var/www/html/web/sites/all/modules/contrib/entity/entity.module on line 1351

Comments

mikran created an issue.