Bakery populates the database field users.init with an account edit URL. There are several problems with this.
It creates a maintenance overhead in case the URL on the master changes, and/or in case the application is cross-platform.
The URL is transmitted as useless baggage in the cookie. The php code has to strip the URL from the content in order to access the only value that really matters - the user ID in the master.
For some reason the field users.init has an additional purpose: To detect whether a user is Bakery enabled.
It would be useful to have an additional database field for this - cheap in comparison with the waste otherwise.
If this cannot be sorted, then one could implement a format for users.init:
"bakery_master_uid_"${uid} e.g. "bakery_master_uid_9999" and have function that extract the two values from the field e.g.
/**
* Detect whether a user is bakery enabled.
*/
function bakery_is_user_bakery_enabled($init) {
return (substr($init, 0, 18) == 'bakery_master_uid_');
}
The account edit URL can then be kept in the PHP code, the "init" field in the cookie can be renamed to "uid" while containing only the primary key.
Postponed
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.