diff --git a/core/modules/system/system.install b/core/modules/system/system.install index d0deae1..83aa7b9 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2188,6 +2188,18 @@ function system_update_8030() { } /** + * Enables file.module. + */ +function system_update_8031() { + // The {file_managed} table has been moved to file.module, so it needs to be + // enabled as manually trying to enable it would fail with a "{file_managed} + // exists already" error. + if (!module_exists('file')) { + update_module_enable(array('file')); + } +} + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */ diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 96373bf..ce4f309 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -342,6 +342,18 @@ function user_install() { */ /** + * Implements hook_update_dependencies(). + */ +function user_update_dependencies() { + // Make sure that file.module is enabled before converting the user picture + // to a field. + $dependencies['user'][8010] = array( + 'system' => 8031, + ); + return $dependencies; +} + +/** * The 'Member for' extra field has moved one level up in the array. */ function user_update_8000() { @@ -595,16 +607,10 @@ function user_update_8009(&$sandbox) { * Create user picture field. */ function user_update_8010() { -// User pictures can only be migrated to the new user picture image field -// if Image module is installed. + // User pictures can only be migrated to the new user picture image field + // if Image module is installed. if (!module_exists('image')) { - $modules = array( - 'image', - ); - if (!module_exists('file')) { - $modules[] = 'file'; - } - update_module_enable($modules); + module_enable(array('image')); } if ($default_image = variable_get('user_picture_default', '')) {