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.
Follow-on from #1035410: Flag any entity.
Flag objects now store the entity info for their entity type when initially constructed, so that they can pull data from it whenever required (such as labels, bundles, key names, etc etc).
The alternative would be to call entity_get_info() every time something is needed from that data.
I have no idea which would be better for performance. Any thoughts?
Comment | File | Size | Author |
---|---|---|---|
#2 | 1689704.flag_.remove-stored-entity-info.patch | 3.46 KB | joachim |
Comments
Comment #1
joachim CreditAttribution: joachim commentedThe decision has been made for us by #871064: Making flaggings fieldable, which would cause circularity here:
The hook_entity_info() added by that patch goes to look at which flag types we have in order to know about flagging bundles. But the flag_entity class calls entity_get_info() in its constructor.
Comment #2
joachim CreditAttribution: joachim commentedHere's a patch for review & the testbot.
Comment #3
joachim CreditAttribution: joachim commented... which wasn't enabled.
Hopefully a new comment will kick it into action :)
Comment #4
joachim CreditAttribution: joachim commentedTests pass, and we need it for #871064: Making flaggings fieldable, and I was a bit iffy about this anyway. Committing!
Issue #1689704 by joachim: Changed flag object to retrieve entity info rather than store it.