updated drupal core to 7.51
This commit is contained in:
@@ -116,38 +116,62 @@ function image_gd_rotate(stdClass $image, $degrees, $background = NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$width = $image->info['width'];
|
||||
$height = $image->info['height'];
|
||||
// PHP 5.5 GD bug: https://bugs.php.net/bug.php?id=65148: To prevent buggy
|
||||
// behavior on negative multiples of 90 degrees we convert any negative
|
||||
// angle to a positive one between 0 and 360 degrees.
|
||||
$degrees -= floor($degrees / 360) * 360;
|
||||
|
||||
// Convert the hexadecimal background value to a color index value.
|
||||
// Convert the hexadecimal background value to a RGBA array.
|
||||
if (isset($background)) {
|
||||
$rgb = array();
|
||||
for ($i = 16; $i >= 0; $i -= 8) {
|
||||
$rgb[] = (($background >> $i) & 0xFF);
|
||||
}
|
||||
$background = imagecolorallocatealpha($image->resource, $rgb[0], $rgb[1], $rgb[2], 0);
|
||||
$background = array(
|
||||
'red' => $background >> 16 & 0xFF,
|
||||
'green' => $background >> 8 & 0xFF,
|
||||
'blue' => $background & 0xFF,
|
||||
'alpha' => 0,
|
||||
);
|
||||
}
|
||||
// Set the background color as transparent if $background is NULL.
|
||||
else {
|
||||
// Get the current transparent color.
|
||||
$background = imagecolortransparent($image->resource);
|
||||
|
||||
// If no transparent colors, use white.
|
||||
if ($background == 0) {
|
||||
$background = imagecolorallocatealpha($image->resource, 255, 255, 255, 0);
|
||||
}
|
||||
// Background color is not specified: use transparent white as background.
|
||||
$background = array(
|
||||
'red' => 255,
|
||||
'green' => 255,
|
||||
'blue' => 255,
|
||||
'alpha' => 127
|
||||
);
|
||||
}
|
||||
|
||||
// Store the color index for the background as that is what GD uses.
|
||||
$background_idx = imagecolorallocatealpha($image->resource, $background['red'], $background['green'], $background['blue'], $background['alpha']);
|
||||
|
||||
// Images are assigned a new color palette when rotating, removing any
|
||||
// transparency flags. For GIF images, keep a record of the transparent color.
|
||||
if ($image->info['extension'] == 'gif') {
|
||||
$transparent_index = imagecolortransparent($image->resource);
|
||||
if ($transparent_index != 0) {
|
||||
$transparent_gif_color = imagecolorsforindex($image->resource, $transparent_index);
|
||||
// GIF does not work with a transparency channel, but can define 1 color
|
||||
// in its palette to act as transparent.
|
||||
|
||||
// Get the current transparent color, if any.
|
||||
$gif_transparent_id = imagecolortransparent($image->resource);
|
||||
if ($gif_transparent_id !== -1) {
|
||||
// The gif already has a transparent color set: remember it to set it on
|
||||
// the rotated image as well.
|
||||
$transparent_gif_color = imagecolorsforindex($image->resource, $gif_transparent_id);
|
||||
|
||||
if ($background['alpha'] >= 127) {
|
||||
// We want a transparent background: use the color already set to act
|
||||
// as transparent, as background.
|
||||
$background_idx = $gif_transparent_id;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The gif does not currently have a transparent color set.
|
||||
if ($background['alpha'] >= 127) {
|
||||
// But as the background is transparent, it should get one.
|
||||
$transparent_gif_color = $background;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$image->resource = imagerotate($image->resource, 360 - $degrees, $background);
|
||||
$image->resource = imagerotate($image->resource, 360 - $degrees, $background_idx);
|
||||
|
||||
// GIFs need to reassign the transparent color after performing the rotate.
|
||||
if (isset($transparent_gif_color)) {
|
||||
|
@@ -1856,7 +1856,7 @@ function system_image_toolkit_settings() {
|
||||
if (count($toolkits_available) == 0) {
|
||||
variable_del('image_toolkit');
|
||||
$form['image_toolkit_help'] = array(
|
||||
'#markup' => t("No image toolkits were detected. Drupal includes support for <a href='!gd-link'>PHP's built-in image processing functions</a> but they were not detected on this system. You should consult your system administrator to have them enabled, or try using a third party toolkit.", array('gd-link' => url('http://php.net/gd'))),
|
||||
'#markup' => t("No image toolkits were detected. Drupal includes support for <a href='!gd-link'>PHP's built-in image processing functions</a> but they were not detected on this system. You should consult your system administrator to have them enabled, or try using a third party toolkit.", array('!gd-link' => url('http://php.net/gd'))),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
@@ -2597,6 +2597,8 @@ function theme_status_report($variables) {
|
||||
if (empty($requirement['#type'])) {
|
||||
$severity = $severities[isset($requirement['severity']) ? (int) $requirement['severity'] : REQUIREMENT_OK];
|
||||
$severity['icon'] = '<div title="' . $severity['title'] . '"><span class="element-invisible">' . $severity['title'] . '</span></div>';
|
||||
// The requirement's 'value' key is optional, provide a default value.
|
||||
$requirement['value'] = isset($requirement['value']) ? $requirement['value'] : '';
|
||||
|
||||
// Output table row(s)
|
||||
if (!empty($requirement['description'])) {
|
||||
|
@@ -1797,6 +1797,8 @@ function hook_form_BASE_FORM_ID_alter(&$form, &$form_state, $form_id) {
|
||||
* the $form_id input matched your module's format for dynamically-generated
|
||||
* form IDs, and if so, act appropriately.
|
||||
*
|
||||
* Third, forms defined in classes can be defined this way.
|
||||
*
|
||||
* @param $form_id
|
||||
* The unique string identifying the desired form.
|
||||
* @param $args
|
||||
@@ -1807,19 +1809,22 @@ function hook_form_BASE_FORM_ID_alter(&$form, &$form_state, $form_id) {
|
||||
* @return
|
||||
* An associative array whose keys define form_ids and whose values are an
|
||||
* associative array defining the following keys:
|
||||
* - callback: The name of the form builder function to invoke. This will be
|
||||
* used for the base form ID, for example, to target a base form using
|
||||
* hook_form_BASE_FORM_ID_alter().
|
||||
* - callback: The callable returning the form array. If it is the name of
|
||||
* the form builder function then this will be used for the base
|
||||
* form ID, for example, to target a base form using
|
||||
* hook_form_BASE_FORM_ID_alter(). Otherwise use the base_form_id key to
|
||||
* define the base form ID.
|
||||
* - callback arguments: (optional) Additional arguments to pass to the
|
||||
* function defined in 'callback', which are prepended to $args.
|
||||
* - wrapper_callback: (optional) The name of a form builder function to
|
||||
* invoke before the form builder defined in 'callback' is invoked. This
|
||||
* wrapper callback may prepopulate the $form array with form elements,
|
||||
* which will then be already contained in the $form that is passed on to
|
||||
* the form builder defined in 'callback'. For example, a wrapper callback
|
||||
* could setup wizard-alike form buttons that are the same for a variety of
|
||||
* forms that belong to the wizard, which all share the same wrapper
|
||||
* callback.
|
||||
* - base_form_id: The base form ID can be specified explicitly. This is
|
||||
* required when callback is not the name of a function.
|
||||
* - wrapper_callback: (optional) Any callable to invoke before the form
|
||||
* builder defined in 'callback' is invoked. This wrapper callback may
|
||||
* prepopulate the $form array with form elements, which will then be
|
||||
* already contained in the $form that is passed on to the form builder
|
||||
* defined in 'callback'. For example, a wrapper callback could setup
|
||||
* wizard-like form buttons that are the same for a variety of forms that
|
||||
* belong to the wizard, which all share the same wrapper callback.
|
||||
*/
|
||||
function hook_forms($form_id, $args) {
|
||||
// Simply reroute the (non-existing) $form_id 'mymodule_first_form' to
|
||||
@@ -1843,6 +1848,15 @@ function hook_forms($form_id, $args) {
|
||||
'wrapper_callback' => 'mymodule_main_form_wrapper',
|
||||
);
|
||||
|
||||
// Build a form with a static class callback.
|
||||
$forms['mymodule_class_generated_form'] = array(
|
||||
// This will call: MyClass::generateMainForm().
|
||||
'callback' => array('MyClass', 'generateMainForm'),
|
||||
// The base_form_id is required when the callback is a static function in
|
||||
// a class. This can also be used to keep newer code backwards compatible.
|
||||
'base_form_id' => 'mymodule_main_form',
|
||||
);
|
||||
|
||||
return $forms;
|
||||
}
|
||||
|
||||
|
@@ -12,8 +12,8 @@ files[] = system.test
|
||||
required = TRUE
|
||||
configure = admin/config/system
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-02-24
|
||||
version = "7.43"
|
||||
; Information added by Drupal.org packaging script on 2016-10-05
|
||||
version = "7.51"
|
||||
project = "drupal"
|
||||
datestamp = "1456343506"
|
||||
datestamp = "1475694174"
|
||||
|
||||
|
@@ -196,6 +196,12 @@ function system_requirements($phase) {
|
||||
);
|
||||
}
|
||||
|
||||
// Test database-specific multi-byte UTF-8 related requirements.
|
||||
$charset_requirements = _system_check_db_utf8mb4_requirements($phase);
|
||||
if (!empty($charset_requirements)) {
|
||||
$requirements['database_charset'] = $charset_requirements;
|
||||
}
|
||||
|
||||
// Test PHP memory_limit
|
||||
$memory_limit = ini_get('memory_limit');
|
||||
$requirements['php_memory_limit'] = array(
|
||||
@@ -517,6 +523,75 @@ function system_requirements($phase) {
|
||||
return $requirements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the requirements for multi-byte UTF-8 support are met.
|
||||
*
|
||||
* @param string $phase
|
||||
* The hook_requirements() stage.
|
||||
*
|
||||
* @return array
|
||||
* A requirements array with the result of the charset check.
|
||||
*/
|
||||
function _system_check_db_utf8mb4_requirements($phase) {
|
||||
global $install_state;
|
||||
// In the requirements check of the installer, skip the utf8mb4 check unless
|
||||
// the database connection info has been preconfigured by hand with valid
|
||||
// information before running the installer, as otherwise we cannot get a
|
||||
// valid database connection object.
|
||||
if (isset($install_state['settings_verified']) && !$install_state['settings_verified']) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$connection = Database::getConnection();
|
||||
$t = get_t();
|
||||
$requirements['title'] = $t('Database 4 byte UTF-8 support');
|
||||
|
||||
$utf8mb4_configurable = $connection->utf8mb4IsConfigurable();
|
||||
$utf8mb4_active = $connection->utf8mb4IsActive();
|
||||
$utf8mb4_supported = $connection->utf8mb4IsSupported();
|
||||
$driver = $connection->driver();
|
||||
$documentation_url = 'https://www.drupal.org/node/2754539';
|
||||
|
||||
if ($utf8mb4_active) {
|
||||
if ($utf8mb4_supported) {
|
||||
if ($phase != 'install' && $utf8mb4_configurable && !variable_get('drupal_all_databases_are_utf8mb4', FALSE)) {
|
||||
// Supported, active, and configurable, but not all database tables
|
||||
// have been converted yet.
|
||||
$requirements['value'] = $t('Enabled, but database tables need conversion');
|
||||
$requirements['description'] = $t('Please convert all database tables to utf8mb4 prior to enabling it in settings.php. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@url' => $documentation_url));
|
||||
$requirements['severity'] = REQUIREMENT_ERROR;
|
||||
}
|
||||
else {
|
||||
// Supported, active.
|
||||
$requirements['value'] = $t('Enabled');
|
||||
$requirements['description'] = $t('4 byte UTF-8 for @driver is enabled.', array('@driver' => $driver));
|
||||
$requirements['severity'] = REQUIREMENT_OK;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Not supported, active.
|
||||
$requirements['value'] = $t('Not supported');
|
||||
$requirements['description'] = $t('4 byte UTF-8 for @driver is activated, but not supported on your system. Please turn this off in settings.php, or ensure that all database-related requirements are met. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@driver' => $driver, '@url' => $documentation_url));
|
||||
$requirements['severity'] = REQUIREMENT_ERROR;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($utf8mb4_supported) {
|
||||
// Supported, not active.
|
||||
$requirements['value'] = $t('Not enabled');
|
||||
$requirements['description'] = $t('4 byte UTF-8 for @driver is not activated, but it is supported on your system. It is recommended that you enable this to allow 4-byte UTF-8 input such as emojis, Asian symbols and mathematical symbols to be stored correctly. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@driver' => $driver, '@url' => $documentation_url));
|
||||
$requirements['severity'] = REQUIREMENT_INFO;
|
||||
}
|
||||
else {
|
||||
// Not supported, not active.
|
||||
$requirements['value'] = $t('Disabled');
|
||||
$requirements['description'] = $t('4 byte UTF-8 for @driver is disabled. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@driver' => $driver, '@url' => $documentation_url));
|
||||
$requirements['severity'] = REQUIREMENT_INFO;
|
||||
}
|
||||
}
|
||||
return $requirements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_install().
|
||||
*/
|
||||
@@ -532,6 +607,9 @@ function system_install() {
|
||||
module_list(TRUE);
|
||||
module_implements('', FALSE, TRUE);
|
||||
|
||||
// Ensure the schema versions are not based on a previous module list.
|
||||
drupal_static_reset('drupal_get_schema_versions');
|
||||
|
||||
// Load system theme data appropriately.
|
||||
system_rebuild_theme_data();
|
||||
|
||||
@@ -3192,6 +3270,21 @@ function system_update_7080() {
|
||||
db_change_field('date_format_locale', 'format', 'format', $spec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the Drupal 6 default install profile if it is still in the database.
|
||||
*/
|
||||
function system_update_7081() {
|
||||
// Sites which used the default install profile in Drupal 6 and then updated
|
||||
// to Drupal 7.44 or earlier will still have a record of this install profile
|
||||
// in the database that needs to be deleted.
|
||||
db_delete('system')
|
||||
->condition('filename', 'profiles/default/default.profile')
|
||||
->condition('type', 'module')
|
||||
->condition('status', 0)
|
||||
->condition('schema_version', 0)
|
||||
->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "defgroup updates-7.x-extra".
|
||||
* The next series of updates should start at 8000.
|
||||
|
@@ -2705,10 +2705,17 @@ function system_find_base_themes($themes, $key, $used_keys = array()) {
|
||||
* @param $show
|
||||
* Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden
|
||||
* regions.
|
||||
* @return
|
||||
* An array of regions in the form $region['name'] = 'description'.
|
||||
* @param bool $labels
|
||||
* (optional) Boolean to specify whether the human readable machine names
|
||||
* should be returned or not. Defaults to TRUE, but calling code can set
|
||||
* this to FALSE for better performance, if it only needs machine names.
|
||||
*
|
||||
* @return array
|
||||
* An associative array of regions in the form $region['name'] = 'description'
|
||||
* if $labels is set to TRUE, or $region['name'] = 'name', if $labels is set
|
||||
* to FALSE.
|
||||
*/
|
||||
function system_region_list($theme_key, $show = REGIONS_ALL) {
|
||||
function system_region_list($theme_key, $show = REGIONS_ALL, $labels = TRUE) {
|
||||
$themes = list_themes();
|
||||
if (!isset($themes[$theme_key])) {
|
||||
return array();
|
||||
@@ -2719,10 +2726,14 @@ function system_region_list($theme_key, $show = REGIONS_ALL) {
|
||||
// If requested, suppress hidden regions. See block_admin_display_form().
|
||||
foreach ($info['regions'] as $name => $label) {
|
||||
if ($show == REGIONS_ALL || !isset($info['regions_hidden']) || !in_array($name, $info['regions_hidden'])) {
|
||||
$list[$name] = t($label);
|
||||
if ($labels) {
|
||||
$list[$name] = t($label);
|
||||
}
|
||||
else {
|
||||
$list[$name] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
@@ -2743,12 +2754,13 @@ function system_system_info_alter(&$info, $file, $type) {
|
||||
*
|
||||
* @param $theme
|
||||
* The name of a theme.
|
||||
*
|
||||
* @return
|
||||
* A string that is the region name.
|
||||
*/
|
||||
function system_default_region($theme) {
|
||||
$regions = array_keys(system_region_list($theme, REGIONS_VISIBLE));
|
||||
return isset($regions[0]) ? $regions[0] : '';
|
||||
$regions = system_region_list($theme, REGIONS_VISIBLE, FALSE);
|
||||
return $regions ? reset($regions) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3317,7 +3329,7 @@ function system_goto_action_form($context) {
|
||||
$form['url'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('URL'),
|
||||
'#description' => t('The URL to which the user should be redirected. This can be an internal URL like node/1234 or an external URL like http://drupal.org.'),
|
||||
'#description' => t('The URL to which the user should be redirected. This can be an internal path like node/1234 or an external URL like http://example.com.'),
|
||||
'#default_value' => isset($context['url']) ? $context['url'] : '',
|
||||
'#required' => TRUE,
|
||||
);
|
||||
@@ -3354,7 +3366,8 @@ function system_goto_action($entity, $context) {
|
||||
*/
|
||||
function system_block_ip_action() {
|
||||
$ip = ip_address();
|
||||
db_insert('blocked_ips')
|
||||
db_merge('blocked_ips')
|
||||
->key(array('ip' => $ip))
|
||||
->fields(array('ip' => $ip))
|
||||
->execute();
|
||||
watchdog('action', 'Banned IP address %ip', array('%ip' => $ip));
|
||||
@@ -3516,8 +3529,7 @@ function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $repl
|
||||
function system_page_alter(&$page) {
|
||||
// Find all non-empty page regions, and add a theme wrapper function that
|
||||
// allows them to be consistently themed.
|
||||
$regions = system_region_list($GLOBALS['theme']);
|
||||
foreach (array_keys($regions) as $region) {
|
||||
foreach (system_region_list($GLOBALS['theme'], REGIONS_ALL, FALSE) as $region) {
|
||||
if (!empty($page[$region])) {
|
||||
$page[$region]['#theme_wrappers'][] = 'region';
|
||||
$page[$region]['#region'] = $region;
|
||||
|
@@ -326,6 +326,7 @@ class MemoryQueue implements DrupalQueueInterface {
|
||||
$item->created = time();
|
||||
$item->expire = 0;
|
||||
$this->queue[$item->item_id] = $item;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public function numberOfItems() {
|
||||
|
@@ -726,7 +726,7 @@ class IPAddressBlockingTestCase extends DrupalWebTestCase {
|
||||
|
||||
// Block a valid IP address.
|
||||
$edit = array();
|
||||
$edit['ip'] = '192.168.1.1';
|
||||
$edit['ip'] = '1.2.3.3';
|
||||
$this->drupalPost('admin/config/people/ip-blocking', $edit, t('Add'));
|
||||
$ip = db_query("SELECT iid from {blocked_ips} WHERE ip = :ip", array(':ip' => $edit['ip']))->fetchField();
|
||||
$this->assertTrue($ip, t('IP address found in database.'));
|
||||
@@ -734,7 +734,7 @@ class IPAddressBlockingTestCase extends DrupalWebTestCase {
|
||||
|
||||
// Try to block an IP address that's already blocked.
|
||||
$edit = array();
|
||||
$edit['ip'] = '192.168.1.1';
|
||||
$edit['ip'] = '1.2.3.3';
|
||||
$this->drupalPost('admin/config/people/ip-blocking', $edit, t('Add'));
|
||||
$this->assertText(t('This IP address is already blocked.'));
|
||||
|
||||
@@ -770,6 +770,25 @@ class IPAddressBlockingTestCase extends DrupalWebTestCase {
|
||||
// $this->drupalPost('admin/config/people/ip-blocking', $edit, t('Save'));
|
||||
// $this->assertText(t('You may not block your own IP address.'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test duplicate IP addresses are not present in the 'blocked_ips' table.
|
||||
*/
|
||||
function testDuplicateIpAddress() {
|
||||
drupal_static_reset('ip_address');
|
||||
$submit_ip = $_SERVER['REMOTE_ADDR'] = '192.168.1.1';
|
||||
system_block_ip_action();
|
||||
system_block_ip_action();
|
||||
$ip_count = db_query("SELECT iid from {blocked_ips} WHERE ip = :ip", array(':ip' => $submit_ip))->rowCount();
|
||||
$this->assertEqual('1', $ip_count);
|
||||
drupal_static_reset('ip_address');
|
||||
$submit_ip = $_SERVER['REMOTE_ADDR'] = ' ';
|
||||
system_block_ip_action();
|
||||
system_block_ip_action();
|
||||
system_block_ip_action();
|
||||
$ip_count = db_query("SELECT iid from {blocked_ips} WHERE ip = :ip", array(':ip' => $submit_ip))->rowCount();
|
||||
$this->assertEqual('1', $ip_count);
|
||||
}
|
||||
}
|
||||
|
||||
class CronRunTestCase extends DrupalWebTestCase {
|
||||
@@ -2354,6 +2373,20 @@ class UpdateScriptFunctionalTest extends DrupalWebTestCase {
|
||||
$this->update_user = $this->drupalCreateUser(array('administer software updates'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that there are no pending updates for the first test method.
|
||||
*/
|
||||
function testNoPendingUpdates() {
|
||||
// Ensure that for the first test method in a class, there are no pending
|
||||
// updates. This tests a drupal_get_schema_versions() bug that previously
|
||||
// led to the wrong schema version being recorded for the initial install
|
||||
// of a child site during automated testing.
|
||||
$this->drupalLogin($this->update_user);
|
||||
$this->drupalGet($this->update_url, array('external' => TRUE));
|
||||
$this->drupalPost(NULL, array(), t('Continue'));
|
||||
$this->assertText(t('No pending updates.'), 'End of update process was reached.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests access to the update script.
|
||||
*/
|
||||
@@ -2435,6 +2468,12 @@ class UpdateScriptFunctionalTest extends DrupalWebTestCase {
|
||||
$this->assertText('This is a requirements error provided by the update_script_test module.');
|
||||
$this->clickLink('try again');
|
||||
$this->assertText('This is a requirements error provided by the update_script_test module.');
|
||||
|
||||
// Check if the optional 'value' key displays without a notice.
|
||||
variable_set('update_script_test_requirement_type', REQUIREMENT_INFO);
|
||||
$this->drupalGet($this->update_url, array('external' => TRUE));
|
||||
$this->assertText('This is a requirements info provided by the update_script_test module.');
|
||||
$this->assertNoText('Notice: Undefined index: value in theme_status_report()');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,7 @@ class ModuleUpdater extends Updater implements DrupalUpdaterInterface {
|
||||
* found on your system, and if there was a copy in sites/all, we'd see it.
|
||||
*/
|
||||
public function getInstallDirectory() {
|
||||
if ($relative_path = drupal_get_path('module', $this->name)) {
|
||||
if ($this->isInstalled() && ($relative_path = drupal_get_path('module', $this->name))) {
|
||||
$relative_path = dirname($relative_path);
|
||||
}
|
||||
else {
|
||||
@@ -34,7 +34,7 @@ class ModuleUpdater extends Updater implements DrupalUpdaterInterface {
|
||||
}
|
||||
|
||||
public function isInstalled() {
|
||||
return (bool) drupal_get_path('module', $this->name);
|
||||
return (bool) drupal_get_filename('module', $this->name, NULL, FALSE);
|
||||
}
|
||||
|
||||
public static function canUpdateDirectory($directory) {
|
||||
@@ -109,7 +109,7 @@ class ThemeUpdater extends Updater implements DrupalUpdaterInterface {
|
||||
* found on your system, and if there was a copy in sites/all, we'd see it.
|
||||
*/
|
||||
public function getInstallDirectory() {
|
||||
if ($relative_path = drupal_get_path('theme', $this->name)) {
|
||||
if ($this->isInstalled() && ($relative_path = drupal_get_path('theme', $this->name))) {
|
||||
$relative_path = dirname($relative_path);
|
||||
}
|
||||
else {
|
||||
@@ -119,7 +119,7 @@ class ThemeUpdater extends Updater implements DrupalUpdaterInterface {
|
||||
}
|
||||
|
||||
public function isInstalled() {
|
||||
return (bool) drupal_get_path('theme', $this->name);
|
||||
return (bool) drupal_get_filename('theme', $this->name, NULL, FALSE);
|
||||
}
|
||||
|
||||
static function canUpdateDirectory($directory) {
|
||||
|
@@ -5,8 +5,8 @@ version = VERSION
|
||||
core = 7.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-02-24
|
||||
version = "7.43"
|
||||
; Information added by Drupal.org packaging script on 2016-10-05
|
||||
version = "7.51"
|
||||
project = "drupal"
|
||||
datestamp = "1456343506"
|
||||
datestamp = "1475694174"
|
||||
|
||||
|
@@ -5,8 +5,8 @@ version = VERSION
|
||||
core = 7.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-02-24
|
||||
version = "7.43"
|
||||
; Information added by Drupal.org packaging script on 2016-10-05
|
||||
version = "7.51"
|
||||
project = "drupal"
|
||||
datestamp = "1456343506"
|
||||
datestamp = "1475694174"
|
||||
|
||||
|
Reference in New Issue
Block a user