The flag attachment plug-in uses the code

         $heartbeatActivity->template->attachments['flagattachment']['flag_flags'][$flagname] = is_object($flag) ? $flag : flag_get_flag($flagname);
          // Store the link.
          $heartbeatActivity->template->attachments['flagattachment']['flag_link'][$flagname] = flag_create_link($flagname, $heartbeatActivity->uaid);
          // Store count to allow theme overrides to use this in another way.
          $heartbeatActivity->template->attachments['flagattachment']['flag_count'][$flagname] = isset($counts[$flagname]) ? $counts[$flagname] : 0;

in flagattachment.inc. This is storing message specific data within the template object of the heartbeatActivity entity. But the template object is a ctools object loaded using ctools_export_crud_load and it is SHARED by all messages of this type. This means all flags, links, counts are corruptable between messages of the same type. Try 'liking' a particular message and you will see a random selection of messages showing (or not showing) this like flag.

This data should not be stored in the template object but in $heartbeatActivity->attachments which currently seems to be present but empty!

Comments

Stalski’s picture

This is bad indeed. I'll look at it asap.

Stalski’s picture

Status: Active » Needs work
Stalski’s picture

Status: Needs work » Needs review

The plugins are totally refactoring. I forgot about the issue why and this is the one.
Ready for testing :)

- Edit - I did not create an upgrade path yet to rebuild the templates so they hold the new structure. You might want to resave the templates with the plugins you want.

Stalski’s picture

Status: Needs review » Closed (fixed)

You can always reopen if a problem would occur. Or I'd prefer a new one since the codebase has changed a lot.