Integrate with the "Availible Updates" Report

philbar - April 24, 2009 - 22:07
Project:Plugin Manager
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

When viewing the "Available updates" report, there should be a link to automatically update all or individual modules using Plugin Manager. Currently, it is incongruent to have a two update locations within Drupal.

#1

philbar - October 26, 2009 - 18:31

I just started using the Admin module and think it is a very nice interface for people who aren't familiar with Drupal, yet need to know how to work with the basic elements of a Drupal website.

One thing I noticed is that the Update feature for Plugin Manager is hidden away and I had a difficult time finding it. I foresee this being an issue for some of my clients. I think keeping drupal code up-to-date is one of the most important things for maintaining a website and it should be easy enough for a new user to figure out.

The easiest fix for this issue with Admin.module is to integrate it with the "Available Updates" report. A simple link to the Update manager when new updates are available would be greatly appreciated.

#2

philbar - November 1, 2009 - 17:13

Here is the section in the core update.module file you want to modify:

<?php
/**
* Helper function to return the appropriate message text when the site is out
* of date or missing a security update.
*
* These error messages are shared by both update_requirements() for the
* site-wide status report at admin/reports/status and in the body of the
* notification emails generated by update_cron().
*
* @param $msg_type
*   String to indicate what kind of message to generate. Can be either
*   'core' or 'contrib'.
* @param $msg_reason
*   Integer constant specifying why message is generated.
* @param $report_link
*   Boolean that controls if a link to the updates report should be added.
* @param $language
*   An optional language object to use.
* @return
*   The properly translated error message for the given key.
*/
function _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $language = NULL) {
 
$langcode = isset($language) ? $language->language : NULL;
 
$text = '';
  switch (
$msg_reason) {
    case
UPDATE_NOT_SECURE:
      if (
$msg_type == 'core') {
       
$text = t('There is a security update available for your version of Drupal. To ensure the security of your server, you should update immediately!', array(), $langcode);
      }
      else {
       
$text = t('There are security updates available for one or more of your modules or themes. To ensure the security of your server, you should update immediately!', array(), $langcode);
      }
      break;

    case
UPDATE_REVOKED:
      if (
$msg_type == 'core') {
       
$text = t('Your version of Drupal has been revoked and is no longer available for download. Upgrading is strongly recommended!', array(), $langcode);
      }
      else {
       
$text = t('The installed version of at least one of your modules or themes has been revoked and is no longer available for download. Upgrading or disabling is strongly recommended!', array(), $langcode);
      }
      break;

    case
UPDATE_NOT_SUPPORTED:
      if (
$msg_type == 'core') {
       
$text = t('Your version of Drupal is no longer supported. Upgrading is strongly recommended!', array(), $langcode);
      }
      else {
       
$text = t('The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended! Please see the project homepage for more details.', array(), $langcode);
      }
      break;

    case
UPDATE_NOT_CURRENT:
      if (
$msg_type == 'core') {
       
$text = t('There are updates available for your version of Drupal. To ensure the proper functioning of your site, you should update as soon as possible.', array(), $langcode);
      }
      else {
       
$text = t('There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible.', array(), $langcode);
      }
      break;

    case
UPDATE_UNKNOWN:
    case
UPDATE_NOT_CHECKED:
    case
UPDATE_NOT_FETCHED:
      if (
$msg_type == 'core') {
       
$text = t('There was a problem determining the status of available updates for your version of Drupal.', array(), $langcode);
      }
      else {
       
$text = t('There was a problem determining the status of available updates for one or more of your modules or themes.', array(), $langcode);
      }
      break;
  }

  if (
$report_link) {
   
$text .= ' '. t('See the <a href="@available_updates">available updates</a> page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), $langcode);
  }

  return
$text;
}
?>

You should add something like this:

"Visit the Plugin Manager: Update page to update your site now."

 
 

Drupal is a registered trademark of Dries Buytaert.