Allowing for better update of user data

Created on 11 March 2016, about 9 years ago
Updated 15 May 2025, 2 days ago

Problem/Motivation

I've been doing some testing with Bakery and found that in some situations where the user details aren't updated when they login. I'm using the transmit/receive hooks to add and retrieve roles from the master site to the slave site, but the slave site never receives updates to changes in the user profile.

Proposed resolution

I have modified the module in two ways.
1) I have updated the _bakery_bake_chocolatechip_cookie() function to accept an additional (optional) parameter of the current user object. This seemed like a better approach than modifying large blocks of code. If the _bakery_bake_chocolatechip_cookie() function finds the user account then it invokes the 'bakery_transmit' hook and adds the output to the 'chocolatechip' cookie information.
2) The login request on the slave site has been modified slightly to include a couple of extra calls to the 'bakery_receive' hook in order to accept the incoming 'chocolatechip' cookie data.
If needed I can also provide the hooks that I'm using to sync user accounts from one site to the other.

Remaining tasks

I'm not entirely certain that this is the best approach here. If that's the case then please let me know as I'm keen to get this working correctly. That said, we have been testing this for the last couple of days and not seen any issues.

User interface changes

N/A.

API changes

None. I have modified the _bakery_bake_chocolatechip_cookie() function, but left the rest of the code intact so it acts in the same way.

Data model changes

None.

Original report by [username]

N/A.

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom philipnorton42 Cheshire

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024