diff --git a/core/modules/user/user.install b/core/modules/user/user.install index b44e988..41d35e2 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -322,25 +322,6 @@ function user_install() { } /** - * Implements hook_requirements(). - */ -function user_requirements($phase) { - $requirements = array(); - $t = get_t(); - - if ($phase == 'update') { - if (variable_get('user_pictures', 1) && !module_exists('image')) { - $requirements['user_picture'] = array( - 'title' => $t('User picture upgrade'), - 'value' => $t('Unresolved dependency'), - 'description' => $t('Use pictures now require the image module. Either enable the image module, or disable user pictures.'), - 'severity' => REQUIREMENT_ERROR, - ); - } - } -} - -/** * @addtogroup updates-7.x-to-8.x * @{ */ @@ -459,7 +440,10 @@ function user_update_8002() { function user_update_8003() { // User pictures can only be migrated to the new user picture image field // if Image module is installed. - if (module_exists('image')) { + if (!module_exists('image')) { + update_module_enable('image'); + } + $default_image = variable_get('user_picture_default', ''); $settings = array( // In D7, user pictures did not require Image module to work. Image module @@ -479,7 +463,6 @@ function user_update_8003() { 'description' => variable_get('user_picture_guidelines', ''), ); _user_install_picture_field($settings); - } // Delete old variables. variable_del('user_pictures'); @@ -496,13 +479,11 @@ function user_update_8003() { */ function user_update_8004(&$sandbox) { // User pictures can only be migrated to the new user picture image field - // if Image module is installed. In this case, we can only delete the - // {users}.picture column, which potentially leads to orphan files in - // {file_managed}, {file_usage}, and the filesystem. + // if Image module is installed. if (!module_exists('image')) { - $sandbox['total'] = 0; - $sandbox['processed'] = 0; + update_module_enable('image'); } + // Initialize total values to process. if (!isset($sandbox['total'])) { $sandbox['total'] = (int) db_query('SELECT COUNT(picture) FROM {users} WHERE picture > 0')->fetchField();