Closed (fixed)
Project:
Flag
Version:
7.x-2.x-dev
Component:
Flag core
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2012 at 16:36 UTC
Updated:
8 Aug 2012 at 10:11 UTC
Jump to comment: Most recent file
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 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 commentedHere's a patch for review & the testbot.
Comment #3
joachim commented... which wasn't enabled.
Hopefully a new comment will kick it into action :)
Comment #4
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.