Update to Drupal 8.0.1. For more information, see https://www.drupal.org/node/2627402

This commit is contained in:
Pantheon Automation 2015-12-02 11:38:43 -08:00 committed by Greg Anderson
parent 013aaaf2ff
commit 1a0e9d9fac
153 changed files with 1268 additions and 670 deletions

View file

@ -107,12 +107,12 @@ class CreateNew extends GDImageToolkitOperationBase {
case IMAGETYPE_GIF:
if (empty($arguments['transparent_color'])) {
// No transparency color specified, fill white.
$fill_color = imagecolorallocate($res, 255, 255, 255);
// No transparency color specified, fill white transparent.
$fill_color = imagecolorallocatealpha($res, 255, 255, 255, 127);
}
else {
$fill_rgb = Color::hexToRgb($arguments['transparent_color']);
$fill_color = imagecolorallocate($res, $fill_rgb['red'], $fill_rgb['green'], $fill_rgb['blue']);
$fill_color = imagecolorallocatealpha($res, $fill_rgb['red'], $fill_rgb['green'], $fill_rgb['blue'], 127);
imagecolortransparent($res, $fill_color);
}
imagefill($res, 0, 0, $fill_color);

View file

@ -465,7 +465,7 @@ class BulkForm extends FieldPluginBase implements CacheableDependencyInterface {
}
// An entity ID could be an arbitrary string (although they are typically
// numeric). JSON then Base64 encoding ensures the the bulk_form_key is
// numeric). JSON then Base64 encoding ensures the bulk_form_key is
// safe to use in HTML, and that the key parts can be retrieved.
$key = json_encode($key_parts);
return base64_encode($key);

View file

@ -83,7 +83,7 @@ class FieldModuleUninstallValidatorTest extends EntityUnitTestBase {
}
catch (ModuleUninstallValidatorException $e) {
$this->pass($message);
$this->assertEqual($e->getMessage(), 'The following reasons prevents the modules from being uninstalled: There is data for the field extra_base_field on entity type Test entity');
$this->assertEqual($e->getMessage(), 'The following reasons prevent the modules from being uninstalled: There is data for the field extra_base_field on entity type Test entity');
}
// Verify uninstalling entity_test is not possible when there is content for

View file

@ -271,13 +271,6 @@ class ToolkitGdTest extends KernelTestBase {
$image_truecolor = imageistruecolor($toolkit->getResource());
$this->assertTrue($image_truecolor, SafeMarkup::format('Image %file after load is a truecolor image.', array('%file' => $file)));
if ($image->getToolkit()->getType() == IMAGETYPE_GIF) {
if ($op == 'desaturate') {
// Transparent GIFs and the imagefilter function don't work together.
$values['corners'][3][3] = 0;
}
}
// Store the original GD resource.
$old_res = $toolkit->getResource();
@ -330,11 +323,21 @@ class ToolkitGdTest extends KernelTestBase {
if ($image->getToolkit()->getType() != IMAGETYPE_JPEG && $image_original_type != IMAGETYPE_JPEG) {
// Now check each of the corners to ensure color correctness.
foreach ($values['corners'] as $key => $corner) {
// The test gif that does not have transparency has yellow where the
// others have transparent.
if ($file === 'image-test-no-transparency.gif' && $corner === $this->transparent) {
$corner = $this->yellow;
// The test gif that does not have transparency color set is a
// special case.
if ($file === 'image-test-no-transparency.gif') {
if ($op == 'desaturate') {
// For desaturating, keep the expected color from the test
// data, but set alpha channel to fully opaque.
$corner[3] = 0;
}
elseif ($corner === $this->transparent) {
// Set expected pixel to yellow where the others have
// transparent.
$corner = $this->yellow;
}
}
// Get the location of the corner.
switch ($key) {
case 0:
@ -436,9 +439,46 @@ class ToolkitGdTest extends KernelTestBase {
}
/**
* Tests loading an image whose transparent color index is out of range.
* Tests for GIF images with transparency.
*/
function testTransparentColorOutOfRange() {
function testGifTransparentImages() {
// Prepare a directory for test file results.
$directory = $this->publicFilesDirectory .'/imagetest';
file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
// Test loading an indexed GIF image with transparent color set.
// Color at top-right pixel should be fully transparent.
$file = 'image-test-transparent-indexed.gif';
$image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file);
$resource = $image->getToolkit()->getResource();
$color_index = imagecolorat($resource, $image->getWidth() - 1, 0);
$color = array_values(imagecolorsforindex($resource, $color_index));
$this->assertEqual($this->rotateTransparent, $color, "Image {$file} after load has full transparent color at corner 1.");
// Test deliberately creating a GIF image with no transparent color set.
// Color at top-right pixel should be fully transparent while in memory,
// fully opaque after flushing image to file.
$file = 'image-test-no-transparent-color-set.gif';
$file_path = $directory . '/' . $file ;
// Create image.
$image = $this->imageFactory->get();
$image->createNew(50, 20, 'gif', NULL);
$resource = $image->getToolkit()->getResource();
$color_index = imagecolorat($resource, $image->getWidth() - 1, 0);
$color = array_values(imagecolorsforindex($resource, $color_index));
$this->assertEqual($this->rotateTransparent, $color, "New GIF image with no transparent color set after creation has full transparent color at corner 1.");
// Save image.
$this->assertTrue($image->save($file_path), "New GIF image {$file} was saved.");
// Reload image.
$image_reloaded = $this->imageFactory->get($file_path);
$resource = $image_reloaded->getToolkit()->getResource();
$color_index = imagecolorat($resource, $image_reloaded->getWidth() - 1, 0);
$color = array_values(imagecolorsforindex($resource, $color_index));
// Check explicitly for alpha == 0 as the rest of the color has been
// compressed and may have slight difference from full white.
$this->assertEqual(0, $color[3], "New GIF image {$file} after reload has no transparent color at corner 1.");
// Test loading an image whose transparent color index is out of range.
// This image was generated by taking an initial image with a palette size
// of 6 colors, and setting the transparent color index to 6 (one higher
// than the largest allowed index), as follows:

View file

@ -133,6 +133,15 @@ class RouteProviderTest extends KernelTestBase {
$this->assertTrue(array_key_exists('/node', $candidates), 'Seventh candidate found.');
}
/**
* Don't fail when given an empty path.
*/
public function testEmptyPathCandidatesOutlines() {
$provider = new TestRouteProvider(Database::getConnection(), $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
$candidates = $provider->getCandidateOutlines([]);
$this->assertEqual(count($candidates), 0, 'Empty parts should return no candidates.');
}
/**
* Confirms that we can find routes with the exact incoming path.
*/

View file

@ -256,7 +256,7 @@ msgid "I have context."
msgstr "I HAZ KONTEX."
EOF;
}
else if ($langcode === 'zz') {
elseif ($langcode === 'zz') {
return <<< EOF
msgid ""
msgstr ""

View file

@ -8,9 +8,7 @@
namespace Drupal\system\Tests\Update;
/**
* Tests the upgrade path for local actions/tasks being converted into blocks.
*
* @see https://www.drupal.org/node/507488
* Tests the upgrade path for page site variables being converted into a block.
*
* @group system
*/

View file

@ -99,18 +99,18 @@ function system_requirements($phase) {
if ($matches[1] < 2) {
$rewrite_error = TRUE;
}
else if ($matches[1] == 2) {
elseif ($matches[1] == 2) {
if (!isset($matches[2])) {
$rewrite_warning = TRUE;
}
else if ($matches[2] < 2) {
elseif ($matches[2] < 2) {
$rewrite_error = TRUE;
}
else if ($matches[2] == 2) {
elseif ($matches[2] == 2) {
if (!isset($matches[3])) {
$rewrite_warning = TRUE;
}
else if ($matches[3] < 16) {
elseif ($matches[3] < 16) {
$rewrite_error = TRUE;
}
}
@ -646,10 +646,21 @@ function system_requirements($phase) {
'value' => t('Up to date'),
];
// Verify that no entity updates are pending.
if (\Drupal::entityDefinitionUpdateManager()->needsUpdates()) {
if ($change_list = \Drupal::entityDefinitionUpdateManager()->getChangeSummary()) {
$build = [];
foreach ($change_list as $entity_type_id => $changes) {
$entity_type = \Drupal::entityManager()->getDefinition($entity_type_id);
$build[] = [
'#theme' => 'item_list',
'#title' => $entity_type->getLabel(),
'#items' => $changes,
];
}
$entity_update_issues = \Drupal::service('renderer')->render($build);
$requirements['entity_update']['severity'] = REQUIREMENT_ERROR;
// @todo Provide details: https://www.drupal.org/node/2554911
$requirements['entity_update']['value'] = t('Mismatched entity and/or field definitions');
$requirements['entity_update']['description'] = t('The following changes were detected in the entity type and field definitions. @updates', ['@updates' => $entity_update_issues]);
}
}

View file

@ -7,7 +7,6 @@
* - children: Contains the child elements of the dropbutton menu.
*
* @see template_preprocess()
* @see template_preprocess_dropbutton_wrapper()
*
* @ingroup themeable
*/

View file

@ -9,9 +9,7 @@
*
* Each item in these variables (primary and secondary) can be individually
* themed in menu-local-task.html.twig.
*
* @see template_preprocess_menu_local_tasks()
*
* @ingroup themeable
*/
#}

View file

@ -11,8 +11,6 @@
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_page_title()
*
* @ingroup themeable
*/
#}

View file

@ -19,11 +19,6 @@
* Site identity:
* - front_page: The URL of the front page. Use this instead of base_path when
* linking to the front page. This includes the language domain or prefix.
* - logo: The url of the logo image, as defined in theme settings.
* - site_name: The name of the site. This is empty when displaying the site
* name has been disabled in the theme settings.
* - site_slogan: The slogan of the site. This is empty when displaying the site
* slogan has been disabled in theme settings.
*
* Page content (in order of occurrence in the default page.html.twig):
* - messages: Status and error messages. Should be displayed prominently.

View file

@ -20,8 +20,6 @@
* - attributes: HTML attributes for the element, including:
* - class: HTML classes.
*
* @see template_preprocess_status_messages()
*
* @ingroup themeable
*/
#}

View file

@ -5,8 +5,8 @@
*
* This template will be used when a system config form specifies 'config_form'
* as its #theme callback. Otherwise, by default, system config forms will be
* themed by theme_form(). This does not alter the appearance of a form at all,
* but is provided as a convenience for themers.
* themed by form.html.twig. This does not alter the appearance of a form at
* all, but is provided as a convenience for themers.
*
* Available variables:
* - form: The confirm form.

View file

@ -6,8 +6,6 @@
* Available variables:
* - style: Either 'asc' or 'desc', indicating the sorting direction.
*
* @see template_preprocess_tablesort_indicator()
*
* @ingroup themeable
*/
#}

View file

@ -61,32 +61,6 @@ function module_test_hook_info() {
return $hooks;
}
/**
* Page callback for 'hook dynamic loading' test.
*
* If the hook is dynamically loaded correctly, the menu callback should
* return 'success!'.
*
* @deprecated \Drupal\module_test\Controller\ModuleTestController::hookDynamicLoadingInvoke()
*/
function module_test_hook_dynamic_loading_invoke() {
$result = \Drupal::moduleHandler()->invoke('module_test', 'test_hook');
return $result['module_test'];
}
/**
* Page callback for 'hook dynamic loading' test.
*
* If the hook is dynamically loaded correctly, the menu callback should
* return 'success!'.
*
* @deprecated \Drupal\module_test\Controller\ModuleTestController::hookDynamicLoadingInvokeAll()
*/
function module_test_hook_dynamic_loading_invoke_all() {
$result = \Drupal::moduleHandler()->invokeAll('test_hook');
return $result['module_test'];
}
/**
* Load function used by module_test_hook_dynamic_loading_invoke_all_during_load().
*
@ -97,23 +71,6 @@ function module_test_load($param) {
return $result[$param];
}
/**
* Page callback for 'class loading' test.
*
* This module does not have a dependency on module_autoload_test.module. If
* that module is enabled, this function should return the string
* 'Drupal\\module_autoload_test\\SomeClass::testMethod() was invoked.'. If
* that module is not enabled, this function should return nothing.
*
* @deprecated \Drupal\module_test\Controller\ModuleTestController::testClassLoading()
*/
function module_test_class_loading() {
if (class_exists('Drupal\module_autoload_test\SomeClass')) {
$obj = new Drupal\module_autoload_test\SomeClass();
return $obj->testMethod();
}
}
/**
* Implements hook_modules_installed().
*/

View file

@ -13,24 +13,40 @@ namespace Drupal\module_test\Controller;
class ModuleTestController {
/**
* @todo Remove module_test_hook_dynamic_loading_invoke().
* Returns dynamically invoked hook results for the 'module_test' module
*
* @return array
* Renderable array.
*/
public function hookDynamicLoadingInvoke() {
return module_test_hook_dynamic_loading_invoke();
$result = \Drupal::moduleHandler()->invoke('module_test', 'test_hook');
return $result['module_test'];
}
/**
* @todo Remove module_test_hook_dynamic_loading_invoke_all().
* Returns dynamically invoked hook results for all modules.
*
* @return array
* Renderable array.
*/
public function hookDynamicLoadingInvokeAll() {
return module_test_hook_dynamic_loading_invoke_all();
$result = \Drupal::moduleHandler()->invokeAll('test_hook');
return $result['module_test'];
}
/**
* @todo Remove module_test_class_loading().
* Returns the result of an autoloaded class's public method.
*
* @return array
* Renderable array.
*/
public function testClassLoading() {
return ['#markup' => module_test_class_loading()];
$markup = NULL;
if (class_exists('Drupal\module_autoload_test\SomeClass')) {
$obj = new \Drupal\module_autoload_test\SomeClass();
$markup = $obj->testMethod();
}
return ['#markup' => $markup];
}
}

View file

@ -8,7 +8,10 @@
use Drupal\Core\Extension\Extension;
/**
* Implements hook_init().
* Includes .theme file from themes.
*
* @param \Drupal\Core\Extension\Extension $theme
* The theme extension object.
*/
function nyan_cat_init(Extension $theme) {
$theme->load();