Fixed User Registration Welcome Conversations

rfc0001

Well-known member
Affected version
2.0.1
In XF 1.5, User Registration Welcome Conversations were sent from the first alias (in order) in the "Other participants".

In XF 2.0.1 they are sent from the first alias alphabetically, which may not be the user you want them sent from (e.g. you may include all admins on the conversation, but want the forum owner who they show as from).

Is this a bug, or by design?
 
This should be fixed for 2.0.2 now. There were a couple issues that meant that the order of the users in this option were essentially non-deterministic. Technically speaking, the display of the option didn't necessarily have to match the order stored in the DB, though it was likely the same. While not guaranteed, the order was likely to be based on user ID.

I've made a few changes to prevent this and some similar issues (this applied to options using the username type with multiple names):
  • The getUsersByNames in the user repository now tries to return the entities in the order they were provided. Previously, there was no deterministic order. This should mostly deal with save-time behaviors that may rely on the order of users.
  • There's a new getUsersByIdsOrdered method in the repo to return users in the order of the given IDs. This is now used on the display side to make that deterministic based on whatever value is saved.
  • The welcome conversation code more explicitly splits out the first user to make doubly sure that this user always remains first (as the order of the remaining recipients doesn't really matter).
 
Top Bottom