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
Comment #1
Stalski commentedThis is bad indeed. I'll look at it asap.
Comment #2
Stalski commentedComment #3
Stalski commentedThe 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.
Comment #4
Stalski commentedYou can always reopen if a problem would occur. Or I'd prefer a new one since the codebase has changed a lot.