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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

socketwench’s picture

Status: Needs review » Reviewed & tested by the community

It looks good to me.

joachim’s picture

Does need to be fixed on 7x3x first?

joachim’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Reviewed & tested by the community » Needs work
hefox’s picture

Status: Needs work » Needs review
FileSize
571 bytes
joachim’s picture

Are we certain at this point that the entity has been remembered in the flag entity cache?

hefox’s picture

It 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

joachim’s picture

Category: feature » task
Status: Needs review » Fixed

That 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 "

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.