diff --git a/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php b/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php index 33fb7d1..914b5fa 100644 --- a/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php +++ b/core/modules/update/lib/Drupal/update/Form/UpdateManagerUpdate.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormBase; -use Drupal\Core\State\StateInterface; +use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -28,7 +28,7 @@ class UpdateManagerUpdate extends FormBase { /** * The Drupal state storage service. * - * @var \Drupal\Core\State\StateInterface + * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface */ protected $state; @@ -37,10 +37,11 @@ class UpdateManagerUpdate extends FormBase { * * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. - * @param \Drupal\Core\State\StateInterface $state - * The state service. + * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state + * The state key/value store interface, gives access to state based config + * settings. */ - public function __construct(ModuleHandlerInterface $module_handler, StateInterface $state) { + public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreInterface $state) { $this->moduleHandler = $module_handler; $this->state = $state; } diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 6c5eab0..361abc2 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -702,73 +702,6 @@ function _update_manager_cache_directory($create = TRUE) { } /** - * Checks for file transfer backends and prepares a form fragment about them. - * - * @param array $form - * Reference to the form array we're building. - * @param string $operation - * The update manager operation we're in the middle of. Can be either 'update' - * or 'install'. Use to provide operation-specific interface text. - * - * @return - * TRUE if the update manager should continue to the next step in the - * workflow, or FALSE if we've hit a fatal configuration and must halt the - * workflow. - */ -function _update_manager_check_backends(&$form, $operation) { - // If file transfers will be performed locally, we do not need to display any - // warnings or notices to the user and should automatically continue the - // workflow, since we won't be using a FileTransfer backend that requires - // user input or a specific server configuration. - if (update_manager_local_transfers_allowed()) { - return TRUE; - } - - // Otherwise, show the available backends. - $form['available_backends'] = array( - '#prefix' => '

', - '#suffix' => '

', - ); - - $available_backends = drupal_get_filetransfer_info(); - if (empty($available_backends)) { - if ($operation == 'update') { - $form['available_backends']['#markup'] = t('Your server does not support updating modules and themes from this interface. Instead, update modules and themes by uploading the new versions directly to the server, as described in the handbook.', array('@handbook_url' => 'http://drupal.org/getting-started/install-contrib')); - } - else { - $form['available_backends']['#markup'] = t('Your server does not support installing modules and themes from this interface. Instead, install modules and themes by uploading them directly to the server, as described in the handbook.', array('@handbook_url' => 'http://drupal.org/getting-started/install-contrib')); - } - return FALSE; - } - - $backend_names = array(); - foreach ($available_backends as $backend) { - $backend_names[] = $backend['title']; - } - if ($operation == 'update') { - $form['available_backends']['#markup'] = format_plural( - count($available_backends), - 'Updating modules and themes requires @backends access to your server. See the handbook for other update methods.', - 'Updating modules and themes requires access to your server via one of the following methods: @backends. See the handbook for other update methods.', - array( - '@backends' => implode(', ', $backend_names), - '@handbook_url' => 'http://drupal.org/getting-started/install-contrib', - )); - } - else { - $form['available_backends']['#markup'] = format_plural( - count($available_backends), - 'Installing modules and themes requires @backends access to your server. See the handbook for other installation methods.', - 'Installing modules and themes requires access to your server via one of the following methods: @backends. See the handbook for other installation methods.', - array( - '@backends' => implode(', ', $backend_names), - '@handbook_url' => 'http://drupal.org/getting-started/install-contrib', - )); - } - return TRUE; -} - -/** * Clears the temporary files and directories based on file age from disk. */ function update_clear_update_disk_cache() {