updated drupal core to 7.43

This commit is contained in:
Bachir Soussi Chiadmi
2016-03-16 16:41:44 +01:00
parent 8fb9c70e42
commit b27aabe359
230 changed files with 4138 additions and 2075 deletions

View File

@@ -7,8 +7,8 @@ dependencies[] = file
files[] = image.test
configure = admin/config/media/image-styles
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -64,7 +64,7 @@ function image_help($path, $arg) {
$effect = image_effect_definition_load($arg[7]);
return isset($effect['help']) ? ('<p>' . $effect['help'] . '</p>') : NULL;
case 'admin/config/media/image-styles/edit/%/effects/%':
$effect = ($arg[5] == 'add') ? image_effect_definition_load($arg[6]) : image_effect_load($arg[6], $arg[4]);
$effect = ($arg[5] == 'add') ? image_effect_definition_load($arg[6]) : image_effect_load($arg[7], $arg[5]);
return isset($effect['help']) ? ('<p>' . $effect['help'] . '</p>') : NULL;
}
}
@@ -801,6 +801,8 @@ function image_style_options($include_empty = TRUE, $output = CHECK_PLAIN) {
*
* @param $style
* The image style
* @param $scheme
* The file scheme, for example 'public' for public files.
*/
function image_style_deliver($style, $scheme) {
$args = func_get_args();
@@ -833,8 +835,8 @@ function image_style_deliver($style, $scheme) {
file_download($scheme, file_uri_target($derivative_uri));
}
else {
$headers = module_invoke_all('file_download', $image_uri);
if (in_array(-1, $headers) || empty($headers)) {
$headers = file_download_headers($image_uri);
if (empty($headers)) {
return MENU_ACCESS_DENIED;
}
if (count($headers)) {

View File

@@ -77,6 +77,24 @@ class ImageFieldTestCase extends DrupalWebTestCase {
return field_create_instance($instance);
}
/**
* Create a random style.
*
* @return array
* A list containing the details of the generated image style.
*/
function createRandomStyle() {
$style_name = strtolower($this->randomName(10));
$style_label = $this->randomString();
image_style_save(array('name' => $style_name, 'label' => $style_label));
$style_path = 'admin/config/media/image-styles/edit/' . $style_name;
return array(
'name' => $style_name,
'label' => $style_label,
'path' => $style_path,
);
}
/**
* Upload an image to a node.
*
@@ -183,6 +201,22 @@ class ImageStylesPathAndUrlTestCase extends DrupalWebTestCase {
$this->assertResponse(404, 'Accessing an image style URL with a source image that does not exist provides a 404 error response.');
}
/**
* Test that we do not pass an array to drupal_add_http_header.
*/
function testImageContentTypeHeaders() {
$files = $this->drupalGetTestFiles('image');
$file = array_shift($files);
// Copy the test file to private folder.
$private_file = file_copy($file, 'private://', FILE_EXISTS_RENAME);
// Tell image_module_test module to return the headers we want to test.
variable_set('image_module_test_invalid_headers', $private_file->uri);
// Invoke image_style_deliver so it will try to set headers.
$generated_url = image_style_url($this->style_name, $private_file->uri);
$this->drupalGet($generated_url);
variable_del('image_module_test_invalid_headers');
}
/**
* Test image_style_url().
*/
@@ -469,6 +503,58 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
}
}
/**
* Tests the administrative user interface.
*/
class ImageAdminUiTestCase extends ImageFieldTestCase {
public static function getInfo() {
return array(
'name' => 'Administrative user interface',
'description' => 'Tests the forms used in the administrative user interface.',
'group' => 'Image',
);
}
function setUp() {
parent::setUp(array('image'));
}
/**
* Test if the help text is available on the add effect form.
*/
function testAddEffectHelpText() {
// Create a random image style.
$style = $this->createRandomStyle();
// Open the add effect form and check for the help text.
$this->drupalGet($style['path'] . '/add/image_crop');
$this->assertText(t('Cropping will remove portions of an image to make it the specified dimensions.'), 'The image style effect help text was displayed on the add effect page.');
}
/**
* Test if the help text is available on the edit effect form.
*/
function testEditEffectHelpText() {
// Create a random image style.
$random_style = $this->createRandomStyle();
// Add the crop effect to the image style.
$edit = array();
$edit['data[width]'] = 20;
$edit['data[height]'] = 20;
$this->drupalPost($random_style['path'] . '/add/image_crop', $edit, t('Add effect'));
// Open the edit effect form and check for the help text.
drupal_static_reset('image_styles');
$style = image_style_load($random_style['name']);
foreach ($style['effects'] as $ieid => $effect) {
$this->drupalGet($random_style['path'] . '/effects/' . $ieid);
$this->assertText(t('Cropping will remove portions of an image to make it the specified dimensions.'), 'The image style effect help text was displayed on the edit effect page.');
}
}
}
/**
* Tests creation, deletion, and editing of image styles and effects.
*/

View File

@@ -6,8 +6,8 @@ core = 7.x
files[] = image_module_test.module
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -9,6 +9,9 @@ function image_module_test_file_download($uri) {
if (variable_get('image_module_test_file_download', FALSE) == $uri) {
return array('X-Image-Owned-By' => 'image_module_test');
}
if (variable_get('image_module_test_invalid_headers', FALSE) == $uri) {
return array('Content-Type' => 'image/png');
}
}
/**