Commit 70b8337cdcbd4b4ec5633bd88fd6a8a81ba71d91 from [#1291100] removed the category system from user edit and view and made several API changes.
This affects a number of hooks, detailed below, and may manifest itself in several ways such as "Notice: Undefined index: #user_category in foo_form_user_profile_form_alter()"
Solution is to remove any references to the legacy category system from module code. For example:
Drupal 7
<?php
function system_form_user_profile_form_alter(&$form, &$form_state) {
if ($form['#user_category'] == 'account') {
if (variable_get('configurable_timezones', 1)) {
system_user_timezone($form, $form_state);
}
return $form;
}
}
?>
Backdrop CMS
<?php
function system_form_user_profile_form_alter(&$form, &$form_state) {
if (config_get('system.date','user_configurable_timezones')) {
system_user_timezone($form, $form_state);
}
return $form;
}
?>
API Changes
Parameter $category
was removed from the signatures of all functions in several modules. Also, a few functions were removed, and one function was added.
Changes to Hooks
The following changes were made to the hook functions. All implementations of these hooks in core were changed accordingly.
Signature Changes
hook_user_presave(&$edit, $account, $category)
tohook_user_presave(&$edit, $account)
hook_user_insert(&$edit, $account, $category)
tohook_user_insert(&$edit, $account)
hook_user_update(&$edit, $account, $category)
tohook_user_update(&$edit, $account)
Removed Functions
hook_user_categories()
Changes to Other API Functions
Signature Changes
- Changed
locale_language_selector_form(&$form, &$form_state, $user)
tolocale_language_selector_form($user)
and returns$form
trigger_user_login(&$edit, $account, $category)
totrigger_user_login(&$edit, $account)
user_module_invoke($type, &$edit, $account, $category = NULL)
touser_module_invoke($type, &$edit, $account)
user_save($account, $edit = array(), $category = 'account')
touser_save($account, $edit = array())
user_profile_form($form, &$form_state, $account, $category = 'account')
touser_profile_form($form, &$form_state, $account)
Added Functions
user_update_8000()
Removed Functions
user_element_info()
user_category_load($uid, &$map, $index)
template_preprocess_user_profile_item(&$variables)
template_preprocess_user_profile_category(&$variables)
Introduced in branch:
1.0.x
Introduced in version:
1.0.0
Impacts:
Module developers
Related Github Issues: