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.
flag has a convenient way of avoiding node_load during 'insert', but flag_flag_access is not using it unlike flag_flag so node_load gets called while the node is being inserted and has $node->flags populated.
Comment | File | Size | Author |
---|---|---|---|
#4 | flag-flag_entity-1896854-4.patch | 571 bytes | hefox |
flag_fetch_content.patch | 576 bytes | hefox | |
Comments
Comment #1
socketwench CreditAttribution: socketwench commentedIt looks good to me.
Comment #2
joachim CreditAttribution: joachim commentedDoes need to be fixed on 7x3x first?
Comment #3
joachim CreditAttribution: joachim commentedComment #4
hefox CreditAttribution: hefox commentedComment #5
joachim CreditAttribution: joachim commentedAre we certain at this point that the entity has been remembered in the flag entity cache?
Comment #6
hefox CreditAttribution: hefox commentedIt doesn't really matter -- it falls back to node_load.
However, no, not initially in 7.x-3.x due to flag field attach save being called before flag_node_save and flag field attach not calling remember content like flag_node_save does as addressed in latest patch in #1064472: separate fields from field instances
Comment #7
joachim CreditAttribution: joachim commentedThat makes sense. (The flag internal cache is one of those parts of this module I'm not yet really familiar with :)
Committed.
git commit -m "Issue #1896854 by hefox: Changed flag_flag_access() to use flag->fetch_content() cache." --author="hefox "