We have a site which allows anonymous flagging. Rules are set up to configure a number of things when a user flags items. However, since there is not user to log them against, anonymous flaggings are ignored in the rules.

However, when the user registers, there is no easy way to pick these up and re-assign them.

This patch changes the way the flags are changed from anonymous -> registered user.

It was a straight db change of user id. There however, does not appear to be any mechanism to hook in the "user change" on flag. To allow for this, the code has been changed to "flag" as the new user and "unflag" the flag on the anonymous user.

Support from Acquia helps fund testing for Drupal Acquia logo