Update to Drupal 8.1.2. For more information, see https://www.drupal.org/project/drupal/releases/8.1.2

This commit is contained in:
Pantheon Automation 2016-06-02 15:56:09 -07:00 committed by Greg Anderson
parent 9eae24d844
commit 28556d630e
1322 changed files with 6699 additions and 2064 deletions

View file

@ -84,4 +84,5 @@ class ConfigurationTest extends WebTestBase {
$action = entity_load('action', $aid);
$this->assertFalse($action, 'Make sure the action is gone after being deleted.');
}
}

View file

@ -99,8 +99,8 @@ class OpmlFeedAdd extends FormBase {
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
// If both fields are empty or filled, cancel.
$file_upload = $this->getRequest()->files->get('files[upload]', NULL, TRUE);
if ($form_state->isValueEmpty('remote') == empty($file_upload)) {
$all_files = $this->getRequest()->files->get('files', []);
if ($form_state->isValueEmpty('remote') == empty($all_files['upload'])) {
$form_state->setErrorByName('remote', $this->t('<em>Either</em> upload a file or enter a URL.'));
}
}

View file

@ -141,4 +141,5 @@ interface ItemInterface extends ContentEntityInterface {
* The called feed item entity.
*/
public function setGuid($guid);
}

View file

@ -35,4 +35,5 @@ class AggregatorXSSFormatter extends FormatterBase {
}
return $elements;
}
}

View file

@ -117,4 +117,5 @@ class DefaultFetcher implements FetcherInterface, ContainerFactoryPluginInterfac
return FALSE;
}
}
}

View file

@ -91,4 +91,5 @@ class AddFeedTest extends AggregatorTestBase {
$this->deleteFeed($feed);
$this->deleteFeed($feed_2);
}
}

View file

@ -80,4 +80,5 @@ class AggregatorAdminTest extends AggregatorTestBase {
$count = $this->container->get('entity.manager')->getStorage('aggregator_item')->getItemCount($feed);
$this->assertEqual(\Drupal::translation()->formatPlural($count, '1 item', '@count items'), (string) $result[0]->td[1]);
}
}

View file

@ -41,4 +41,5 @@ class AggregatorCronTest extends AggregatorTestBase {
$this->cronRun();
$this->assertEqual(5, db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->id()))->fetchField());
}
}

View file

@ -370,4 +370,5 @@ EOF;
))
->save();
}
}

View file

@ -36,4 +36,5 @@ class DeleteFeedItemTest extends AggregatorTestBase {
$this->deleteFeed($feed);
}
}
}

View file

@ -59,4 +59,5 @@ class FeedAdminDisplayTest extends AggregatorTestBase {
$this->assertText('ago', 'The non scheduled feed has been updated. It shows "x x ago" as last update.');
$this->assertNoText('left', 'The feed is not scheduled. It does not show a timeframe "x x left" for next update.');
}
}

View file

@ -40,4 +40,5 @@ class FeedFetcherPluginTest extends AggregatorTestBase {
// Fetch should fail due to feed name.
$this->assertTrue(empty($feed->items));
}
}

View file

@ -81,4 +81,5 @@ class FeedLanguageTest extends AggregatorTestBase {
}
}
}
}

View file

@ -107,4 +107,5 @@ class FeedParserTest extends AggregatorTestBase {
$this->clickLink(t('Update items'));
$this->assertRaw(t('The feed from %title seems to be broken because of error', array('%title' => $feed->label())));
}
}

View file

@ -63,4 +63,5 @@ class FeedProcessorPluginTest extends AggregatorTestBase {
// Make sure its refresh rate doubled.
$this->assertEqual($feed->getRefreshRate(), 3600);
}
}

View file

@ -120,4 +120,5 @@ class ImportOpmlTest extends AggregatorTestBase {
$this->validateImportFormFields();
$this->submitImportForm();
}
}

View file

@ -66,4 +66,5 @@ class UpdateFeedItemTest extends AggregatorTestBase {
$this->updateFeedItems($feed);
$this->assertResponse(200);
}
}

View file

@ -42,4 +42,5 @@ class UpdateFeedTest extends AggregatorTestBase {
$this->deleteFeed($feed);
}
}
}

View file

@ -28,4 +28,5 @@ class TestFetcher extends DefaultFetcher implements FetcherInterface {
}
return parent::fetch($feed);
}
}

View file

@ -27,4 +27,5 @@ class TestParser extends DefaultParser implements ParserInterface {
public function parse(FeedInterface $feed) {
return parent::parse($feed);
}
}

View file

@ -43,7 +43,7 @@ class AggregatorTitleTest extends KernelTestBase {
$this->fieldName = 'title';
}
/*
/**
* Tests the formatter output.
*/
public function testStringFormatter() {

View file

@ -44,4 +44,5 @@ class MigrateAggregatorFeedTest extends MigrateDrupal6TestBase {
$this->assertIdentical('"213cc1365b96c310e92053c5551f0504"', $feed->etag->value);
$this->assertIdentical('0', $feed->modified->value);
}
}

View file

@ -16,13 +16,13 @@ function automated_cron_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.automated_cron':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Automated Cron module runs cron operations for your site using normal browser/page requests instead of having to set up a separate cron job. The Automated Cron module checks at the end of each server response when cron operation was last ran and, if it has been too long since last run, it executes the cron tasks after sending a server response. For more information, see the <a href=":automated_cron-documentation">online documentation for the Automated Cron module</a>.', [':automated_cron-documentation' => 'https://www.drupal.org/documentation/modules/automated_cron']) . '</p>';
$output .= '<p>' . t('The Automated Cron module runs cron operations for your site using normal browser/page requests instead of having to set up a separate cron job. The Automated Cron module checks at the end of each server response when cron operation was last ran and, if it has been too long since last run, it executes the cron tasks after sending a server response. For more information, see the <a href=":automated_cron-documentation">online documentation for the Automated Cron module</a>.', [':automated_cron-documentation' => 'https://www.drupal.org/documentation/modules/automated_cron']) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Configuring Automated Cron') . '</dt>';
$output .= '<dd>' . t('On the <a href=":cron-settings">Cron page</a>, you can set the frequency (time interval) for running cron jobs.', [':cron-settings' => \Drupal::url('system.cron_settings')]) . '</dd>';
$output .= '<dd>' . t('On the <a href=":cron-settings">Cron page</a>, you can set the frequency (time interval) for running cron jobs.', [':cron-settings' => \Drupal::url('system.cron_settings')]) . '</dd>';
$output .= '<dt>' . t('Disabling Automated Cron') . '</dt>';
$output .= '<dd>' . t('To disable automated cron, the recommended method is to uninstall the module, to reduce site overhead. If you only want to disable it temporarily, you can set the frequency to Never on the Cron page, and then change the frequency back when you want to start it up again.') . '</dd>';
$output .= '<dd>' . t('To disable automated cron, the recommended method is to uninstall the module, to reduce site overhead. If you only want to disable it temporarily, you can set the frequency to Never on the Cron page, and then change the frequency back when you want to start it up again.') . '</dd>';
$output .= '</dl>';
return $output;
}

View file

@ -64,4 +64,5 @@ class BanIpManager implements BanIpManagerInterface {
public function findById($ban_id) {
return $this->connection->query("SELECT ip FROM {ban_ip} WHERE iid = :iid", array(':iid' => $ban_id))->fetchField();
}
}

View file

@ -74,4 +74,5 @@ class IpAddressBlockingTest extends WebTestBase {
// $this->drupalPostForm('admin/config/people/ban', $edit, t('Save'));
// $this->assertText(t('You may not ban your own IP address.'));
}
}

View file

@ -20,4 +20,5 @@ use Drupal\Component\Render\MarkupTrait;
*/
final class BigPipeMarkup implements MarkupInterface, \Countable {
use MarkupTrait;
}

View file

@ -221,7 +221,7 @@ class BigPipeStrategy implements PlaceholderStrategyInterface {
*/
protected static function createBigPipeNoJsPlaceholder($original_placeholder, array $placeholder_render_array, $placeholder_must_be_attribute_safe = FALSE) {
if (!$placeholder_must_be_attribute_safe) {
$big_pipe_placeholder = '<div data-big-pipe-nojs-placeholder-id="' . Html::escape(static::generateBigPipePlaceholderId($original_placeholder, $placeholder_render_array)) . '"></div>';
$big_pipe_placeholder = '<div data-big-pipe-nojs-placeholder-id="' . Html::escape(static::generateBigPipePlaceholderId($original_placeholder, $placeholder_render_array)) . '"></div>';
}
else {
$big_pipe_placeholder = 'big_pipe_nojs_placeholder_attribute_safe:' . Html::escape($original_placeholder);

View file

@ -138,7 +138,7 @@ class Block extends DrupalSqlBase {
$settings['book']['block_mode'] = $this->variableGet('book_block_mode', 'all pages');
break;
case 'forum':
$settings['forum']['block_num'] = $this->variableGet('forum_block_num_'. $delta, 5);
$settings['forum']['block_num'] = $this->variableGet('forum_block_num_' . $delta, 5);
break;
case 'statistics':
foreach (array('statistics_block_top_day_num', 'statistics_block_top_all_num', 'statistics_block_top_last_num') as $name) {

View file

@ -31,7 +31,7 @@ class BlockHookOperationTest extends WebTestBase {
$this->drupalLogin($admin_user);
}
/*
/**
* Tests the block list to see if the test_operation link is added.
*/
public function testBlockOperationAlter() {

View file

@ -59,4 +59,5 @@ class BlockInvalidRegionTest extends WebTestBase {
$this->drupalPostForm('admin/config/development/performance', array(), 'Clear all caches');
$this->assertNoRaw($warning_message, 'Disabled block in the invalid region will not trigger the warning.');
}
}

View file

@ -73,4 +73,5 @@ class BlockLanguageCacheTest extends WebTestBase {
$this->assertText($edit['label']);
}
}
}

View file

@ -69,11 +69,12 @@ class BlockRenderOrderTest extends WebTestBase {
foreach ($controller->loadMultiple() as $return_block) {
$id = $return_block->id();
if ($return_block_weight = $return_block->getWeight()) {
$this->assertTrue($test_blocks[$id]['weight'] == $return_block_weight, 'Block weight is set as "' . $return_block_weight . '" for ' . $id . ' block.');
$this->assertTrue($test_blocks[$id]['weight'] == $return_block_weight, 'Block weight is set as "' . $return_block_weight . '" for ' . $id . ' block.');
$position[$id] = strpos($test_content, Html::getClass('block-' . $test_blocks[$id]['id']));
}
}
$this->assertTrue($position['stark_powered'] < $position['stark_by'], 'Blocks with different weight are rendered in the correct order.');
$this->assertTrue($position['stark_drupal'] < $position['stark_by'], 'Blocks with identical weight are rendered in alphabetical order.');
}
}

View file

@ -67,4 +67,5 @@ abstract class BlockTestBase extends WebTestBase {
$block->delete();
}
}
}

View file

@ -119,12 +119,12 @@ class BlockUiTest extends WebTestBase {
foreach ($this->blockValues as $values) {
// Check if the region and weight settings changes have persisted.
$this->assertOptionSelected(
'edit-blocks-' . $values['settings']['id'] . '-region',
'edit-blocks-' . $values['settings']['id'] . '-region',
'header',
'The block "' . $label . '" has the correct region assignment (header).'
);
$this->assertOptionSelected(
'edit-blocks-' . $values['settings']['id'] . '-weight',
'edit-blocks-' . $values['settings']['id'] . '-weight',
$values['test_weight'],
'The block "' . $label . '" has the correct weight assignment (' . $values['test_weight'] . ').'
);

View file

@ -38,4 +38,5 @@ class NonDefaultBlockAdminTest extends WebTestBase {
$this->drupalGet('admin/structure/block/list/' . $new_theme);
$this->assertText('Bartik(' . t('active tab') . ')', 'Tab for non-default theme found.');
}
}

View file

@ -2,7 +2,7 @@
/**
* @file
* Provide test blocks.
* Provide test blocks.
*/
use Drupal\Core\Block\BlockPluginInterface;

View file

@ -8,7 +8,7 @@ use Drupal\Core\Form\FormState;
/**
* Controller for block_test module
*/
class TestMultipleFormController extends ControllerBase {
class TestMultipleFormController extends ControllerBase {
public function testMultipleForms() {
$form_state = new FormState();

View file

@ -11,7 +11,6 @@ use Drupal\Core\Condition\ConditionPluginBase;
* id = "baloney_spam",
* label = @Translation("Baloney spam"),
* )
*
*/
class BaloneySpam extends ConditionPluginBase {

View file

@ -99,4 +99,5 @@ class BlockInterfaceTest extends KernelTestBase {
// testing BlockBase's implementation, not the interface itself.
$this->assertIdentical($display_block->getMachineNameSuggestion(), 'displaymessage', 'The plugin returned the expected machine name suggestion.');
}
}

View file

@ -16,7 +16,7 @@ class MigrateBlockTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
static $modules = [
public static $modules = [
'block',
'views',
'comment',

View file

@ -54,4 +54,5 @@ class BlockContent extends DeriverBase implements ContainerDeriverInterface {
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}
}

View file

@ -101,4 +101,5 @@ class BlockContentCacheTagsTest extends EntityCacheTagsTestBase {
$redirected_cid = $this->createCacheId($expected_block_cache_keys, Cache::mergeContexts($expected_block_cache_contexts, $expected_entity_cache_contexts));
$this->verifyRenderCache($cid, Cache::mergeTags($expected_block_cache_tags, $expected_entity_cache_tags), ($cid !== $redirected_cid) ? $redirected_cid : NULL);
}
}

View file

@ -105,4 +105,5 @@ class BlockContentFieldFilterTest extends BlockContentTestBase {
$this->assertEqual(substr_count($text, $this->blockContentInfos[$langcode]), $count, 'Translation ' . $langcode . ' has count ' . $count . ' with ' . $message);
}
}
}

View file

@ -25,12 +25,12 @@ function block_content_test_block_content_view(array &$build, BlockContent $bloc
*/
function block_content_test_block_content_presave(BlockContent $block_content) {
if ($block_content->label() == 'testing_block_content_presave') {
$block_content->setInfo($block_content->label() .'_presave');
$block_content->setInfo($block_content->label() . '_presave');
}
// Determine changes.
if (!empty($block_content->original) && $block_content->original->label() == 'test_changes') {
if ($block_content->original->label() != $block_content->label()) {
$block_content->setInfo($block_content->label() .'_presave');
$block_content->setInfo($block_content->label() . '_presave');
// Drupal 1.0 release.
$block_content->changed = 979534800;
}
@ -44,7 +44,7 @@ function block_content_test_block_content_update(BlockContent $block_content) {
// Determine changes on update.
if (!empty($block_content->original) && $block_content->original->label() == 'test_changes') {
if ($block_content->original->label() != $block_content->label()) {
$block_content->setInfo($block_content->label() .'_update');
$block_content->setInfo($block_content->label() . '_update');
}
}
}

View file

@ -15,7 +15,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/
class MigrateBlockContentBodyFieldTest extends MigrateDrupal7TestBase {
static $modules = array('block', 'block_content', 'filter', 'text');
public static $modules = array('block', 'block_content', 'filter', 'text');
/**
* {@inheritdoc}

View file

@ -13,7 +13,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/
class MigrateBlockContentTypeTest extends MigrateDrupal7TestBase {
static $modules = array('block', 'block_content', 'filter', 'text');
public static $modules = array('block', 'block_content', 'filter', 'text');
/**
* {@inheritdoc}

View file

@ -127,7 +127,7 @@ function book_node_links_alter(array &$links, NodeInterface $node, array &$conte
}
/**
* Implements hook_form_BASE_FORM_ID_alter() for node_form().
* Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
*
* Adds the book form element to the node form.
*
@ -323,7 +323,7 @@ function book_node_prepare_form(NodeInterface $node, $operation, FormStateInterf
}
/**
* Implements hook_form_BASE_FORM_ID_alter().
* Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\Form\NodeDeleteForm.
*
* Alters the confirm form for a single node deletion.
*/

View file

@ -10,7 +10,7 @@ use Drupal\node\NodeInterface;
/**
* Determines whether the requested node can be removed from its book.
*/
class BookNodeIsRemovableAccessCheck implements AccessInterface{
class BookNodeIsRemovableAccessCheck implements AccessInterface {
/**
* Book Manager Service.

View file

@ -720,7 +720,7 @@ class BookManager implements BookManagerInterface {
* @param array $flat
* A flat array of the menu links from $tree, passed by reference.
*
* @see static::bookTreeGetFlat().
* @see static::bookTreeGetFlat()
*/
protected function flatBookTree(array $tree, array &$flat) {
foreach ($tree as $data) {
@ -1045,7 +1045,6 @@ class BookManager implements BookManagerInterface {
*
* @return array
* Book tree.
*
*/
protected function buildBookOutlineRecursive(&$links, $parents, $depth) {
$tree = array();

View file

@ -81,7 +81,6 @@ interface BookManagerInterface {
*
* @param int[] $nids
* An array of nids to load.
*
* @param bool $translate
* If TRUE, set access, title, and other elements.
*

View file

@ -198,4 +198,5 @@ class BookOutlineStorage implements BookOutlineStorageInterface {
}
return $query->execute();
}
}

View file

@ -49,7 +49,6 @@ interface BookOutlineStorageInterface {
*
* @param array $book_link
* The book link.
*
* @param int $max_depth
* The maximum supported depth of the book tree.
*
@ -166,4 +165,5 @@ interface BookOutlineStorageInterface {
* Array of unordered subtree book items.
*/
public function getBookSubtree($link, $max_depth);
}

View file

@ -71,7 +71,6 @@ class BookController extends ControllerBase {
*
* @return array
* A render array representing the administrative page content.
*
*/
public function adminOverview() {
$rows = array();

View file

@ -15,7 +15,7 @@ function breakpoint_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.breakpoint':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Breakpoint module keeps track of the height, width, and resolution breakpoints where a responsive design needs to change in order to respond to different devices being used to view the site. This module does not have a user interface. For more information, see the <a href=":docs">online documentation for the Breakpoint module</a>.', array(':docs' => 'https://www.drupal.org/documentation/modules/breakpoint')) . '</p>';
$output .= '<p>' . t('The Breakpoint module keeps track of the height, width, and resolution breakpoints where a responsive design needs to change in order to respond to different devices being used to view the site. This module does not have a user interface. For more information, see the <a href=":docs">online documentation for the Breakpoint module</a>.', array(':docs' => 'https://www.drupal.org/documentation/modules/breakpoint')) . '</p>';
$output .= '<h4>' . t('Terminology') . '</h4>';
$output .= '<dl>';
$output .= '<dt>' . t('Breakpoint') . '</dt>';

View file

@ -44,7 +44,7 @@ function hook_ckeditor_plugin_info_alter(array &$plugins) {
*
* @param array &$css
* An array of CSS files, passed by reference. This is a flat list of file
* paths relative to the Drupal root.
* paths which can be either relative to the Drupal root or external URLs.
* @param $editor
* The text editor object as returned by editor_load(), for which these files
* are being loaded. Based on this information, it is possible to load the

View file

@ -5,6 +5,7 @@
* Provides integration with the CKEditor WYSIWYG editor.
*/
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\editor\Entity\Editor;
@ -85,8 +86,13 @@ function _ckeditor_theme_css($theme = NULL) {
$info = system_get_info('theme', $theme);
if (isset($info['ckeditor_stylesheets'])) {
$css = $info['ckeditor_stylesheets'];
foreach ($css as $key => $path) {
$css[$key] = $theme_path . '/' . $path;
foreach ($css as $key => $url) {
if (UrlHelper::isExternal($url)) {
$css[$key] = $url;
}
else {
$css[$key] = $theme_path . '/' . $url;
}
}
}
if (isset($info['base theme'])) {

View file

@ -50,4 +50,5 @@ abstract class CKEditorPluginBase extends PluginBase implements CKEditorPluginIn
function getLibraries(Editor $editor) {
return array();
}
}

View file

@ -95,4 +95,5 @@ interface CKEditorPluginInterface extends PluginInspectionInterface {
* A keyed array, whose keys will end up as keys under CKEDITOR.config.
*/
public function getConfig(Editor $editor);
}

View file

@ -194,6 +194,36 @@ class CKEditorLoadingTest extends WebTestBase {
$this->assertTrue(isset($editor_settings['disallowedContent']));
}
/**
* Tests loading of theme's CKEditor stylesheets defined in the .info file.
*/
function testExternalStylesheets() {
$theme_handler = \Drupal::service('theme_handler');
// Case 1: Install theme which has an absolute external CSS URL.
$theme_handler->install(['test_ckeditor_stylesheets_external']);
$theme_handler->setDefault('test_ckeditor_stylesheets_external');
$expected = [
'https://fonts.googleapis.com/css?family=Open+Sans',
];
$this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_external'));
// Case 2: Install theme which has an external protocol-relative CSS URL.
$theme_handler->install(['test_ckeditor_stylesheets_protocol_relative']);
$theme_handler->setDefault('test_ckeditor_stylesheets_protocol_relative');
$expected = [
'//fonts.googleapis.com/css?family=Open+Sans',
];
$this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_protocol_relative'));
// Case 3: Install theme which has a relative CSS URL.
$theme_handler->install(['test_ckeditor_stylesheets_relative']);
$theme_handler->setDefault('test_ckeditor_stylesheets_relative');
$expected = [
'core/modules/system/tests/themes/test_ckeditor_stylesheets_relative/css/yokotsoko.css',
];
$this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_relative'));
}
protected function getThingsToCheck() {
$settings = $this->getDrupalSettings();
return array(
@ -211,4 +241,5 @@ class CKEditorLoadingTest extends WebTestBase {
$this->xpath('//select[contains(@class, "filter-list")]'),
);
}
}

View file

@ -76,7 +76,7 @@ function color_library_info_alter(&$libraries, $extension) {
$color_paths = \Drupal::config('color.theme.' . $extension)->get('stylesheets');
if (!empty($color_paths)) {
foreach (array_keys($libraries) as $name) {
if(isset($libraries[$name]['css'])) {
if (isset($libraries[$name]['css'])) {
// Override stylesheets.
foreach ($libraries[$name]['css'] as $category => $css_assets) {
foreach ($css_assets as $path => $metadata) {

View file

@ -54,5 +54,4 @@ class ColorSafePreviewTest extends WebTestBase {
$this->assertRaw('<h2>TEST COLOR PREVIEW</h2>');
}
}

View file

@ -164,7 +164,7 @@ class ColorTest extends WebTestBase {
$edit['palette[bg]'] = $color;
$this->drupalPostForm($settings_path, $edit, t('Save configuration'));
if($is_valid) {
if ($is_valid) {
$this->assertText('The configuration options have been saved.');
}
else {

View file

@ -389,4 +389,5 @@ class CommentForm extends ContentEntityForm {
}
$form_state->setRedirectUrl($uri);
}
}

View file

@ -214,4 +214,5 @@ class CommentAdminTest extends CommentTestBase {
$this->drupalGet('comment/' . $anonymous_comment->id() . '/edit');
$this->assertFieldById('edit-mail', $anonymous_comment->getAuthorEmail());
}
}

View file

@ -104,7 +104,7 @@ class CommentNewIndicatorTest extends CommentTestBase {
// value, the drupal.node-new-comments-link library would determine that the
// node received a comment after the user last viewed it, and hence it would
// perform an HTTP request to render the "new comments" node link.
$this->assertIdentical(1, count($this->xpath('//*[@data-history-node-last-comment-timestamp="' . $comment->getChangedTime() . '"]')), 'data-history-node-last-comment-timestamp attribute is set to the correct value.');
$this->assertIdentical(1, count($this->xpath('//*[@data-history-node-last-comment-timestamp="' . $comment->getChangedTime() . '"]')), 'data-history-node-last-comment-timestamp attribute is set to the correct value.');
$this->assertIdentical(1, count($this->xpath('//*[@data-history-node-field-name="comment"]')), 'data-history-node-field-name attribute is set to the correct value.');
// The data will be pre-seeded on this particular page in drupalSettings, to
// avoid the need for the client to make a separate request to the server.

View file

@ -78,4 +78,5 @@ class CommentNodeAccessTest extends CommentTestBase {
$this->assertText($reply_text);
$this->assertText($reply_subject);
}
}

View file

@ -31,4 +31,5 @@ class CommentNodeChangesTest extends CommentTestBase {
$this->assertNull(FieldStorageConfig::load('node.comment'), 'Comment field storage deleted');
$this->assertNull(FieldConfig::load('node.article.comment'), 'Comment field deleted');
}
}

View file

@ -75,4 +75,5 @@ class CommentRssTest extends CommentTestBase {
$this->drupalGet('rss.xml');
$this->assertNoRaw($raw, 'Hidden comments is not a part of RSS feed.');
}
}

View file

@ -60,4 +60,5 @@ class CommentTitleTest extends CommentTestBase {
// Tests that markup is created for comment with heading.
$this->assertPattern('|<h3[^>]*><a[^>]*>' . $subject_text . '</a></h3>|', 'Comment title is rendered in h3 when title populated.');
}
}

View file

@ -116,4 +116,5 @@ class CommentFieldFilterTest extends CommentTestBase {
$this->assertEqual(substr_count($text, $this->commentTitles[$langcode]), 2 * $count, 'Translation ' . $langcode . ' has count ' . $count . ' with ' . $message);
}
}
}

View file

@ -80,7 +80,7 @@ class CommentDefaultFormatterCacheTagsTest extends EntityKernelTestBase {
$renderer->renderRoot($build);
$expected_cache_tags = [
'entity_test_view',
'entity_test:' . $commented_entity->id(),
'entity_test:' . $commented_entity->id(),
'config:core.entity_form_display.comment.comment.default',
'config:field.field.comment.comment.comment_body',
'config:field.field.entity_test.entity_test.comment',

View file

@ -56,7 +56,7 @@ class MigrateCommentTest extends MigrateDrupal6TestBase {
$this->assertIdentical('The first comment.', $comment->getSubject());
$this->assertIdentical('The first comment body.', $comment->comment_body->value);
$this->assertIdentical('filtered_html', $comment->comment_body->format);
$this->assertIdentical('0', $comment->pid->target_id);
$this->assertIdentical(NULL, $comment->pid->target_id);
$this->assertIdentical('1', $comment->getCommentedEntityId());
$this->assertIdentical('node', $comment->getCommentedEntityTypeId());
$this->assertIdentical('en', $comment->language()->getId());
@ -68,6 +68,7 @@ class MigrateCommentTest extends MigrateDrupal6TestBase {
$comment = $comment_storage->load(3);
$this->assertIdentical('The second comment.', $comment->subject->value);
$this->assertIdentical('0', $comment->pid->target_id);
$this->assertIdentical(NULL, $comment->pid->target_id);
}
}

View file

@ -30,4 +30,5 @@ class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisp
$this->assertIdentical(20, $component['weight']);
}
}
}

View file

@ -172,4 +172,5 @@ class CommentLinksTest extends CommentViewsKernelTestBase {
$replyto_comment = $view->style_plugin->getField(0, 'replyto_comment');
$this->assertFalse((string) $replyto_comment, "Didn't find the comment reply link as an anonymous user.");
}
}

View file

@ -120,4 +120,5 @@ class CommentStatisticsUnitTest extends UnitTestCase {
break;
}
}
}

View file

@ -22,7 +22,7 @@ function config_help($route_name, RouteMatchInterface $route_match) {
$output .= '<dd>' . t('You can create and download an archive consisting of all your site\'s configuration exported as <em>*.yml</em> files on the <a href=":url">Export</a> page.', array(':url' => \Drupal::url('config.export_full'))) . '</dd>';
$output .= '<dt>' . t('Importing a full configuration') . '</dt>';
$output .= '<dd>' . t('You can upload a full site configuration from an archive file on the <a href=":url">Import</a> page. When importing data from a different environment, the site and import files must have matching configuration values for UUID in the <em>system.site</em> configuration item. That means that your other environments should initially be set up as clones of the target site. Migrations are not supported.', array(':url' => \Drupal::url('config.import_full'))) . '</dd>';
$output .= '<dt>' . t('Synchronizing configuration'). '</dt>';
$output .= '<dt>' . t('Synchronizing configuration') . '</dt>';
$output .= '<dd>' . t('You can review differences between the active configuration and an imported configuration archive on the <a href=":synchronize">Synchronize</a> page to ensure that the changes are as expected, before finalizing the import. The Synchronize page also shows configuration items that would be added or removed.', array(':synchronize' => \Drupal::url('config.sync'))) . '</dd>';
$output .= '<dt>' . t('Exporting a single configuration item') . '</dt>';
$output .= '<dd>' . t('You can export a single configuration item by selecting a <em>Configuration type</em> and <em>Configuration name</em> on the <a href=":single-export">Single export</a> page. The configuration and its corresponding <em>*.yml file name</em> are then displayed on the page for you to copy.', array(':single-export' => \Drupal::url('config.export_single'))) . '</dd>';
@ -69,7 +69,7 @@ function config_file_download($uri) {
$date = DateTime::createFromFormat('U', $request->server->get('REQUEST_TIME'));
$date_string = $date->format('Y-m-d-H-i');
$hostname = str_replace('.', '-', $request->getHttpHost());
$filename = 'config' . '-' . $hostname . '-' . $date_string. '.tar.gz';
$filename = 'config' . '-' . $hostname . '-' . $date_string . '.tar.gz';
$disposition = 'attachment; filename="' . $filename . '"';
return array(
'Content-disposition' => $disposition,

View file

@ -33,4 +33,5 @@ class ConfigSubscriber extends ConfigImportValidateEventSubscriberBase {
$events[ConfigEvents::IMPORT_VALIDATE][] = array('onConfigImporterValidate', 20);
return $events;
}
}

View file

@ -160,4 +160,5 @@ class ConfigController implements ContainerInjectionInterface {
return $build;
}
}

View file

@ -67,13 +67,16 @@ class ConfigImportForm extends FormBase {
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
$file_upload = $this->getRequest()->files->get('files[import_tarball]', NULL, TRUE);
if ($file_upload && $file_upload->isValid()) {
$form_state->setValue('import_tarball', $file_upload->getRealPath());
}
else {
$form_state->setErrorByName('import_tarball', $this->t('The file could not be uploaded.'));
$all_files = $this->getRequest()->files->get('files', []);
if (!empty($all_files['import_tarball'])) {
$file_upload = $all_files['import_tarball'];
if ($file_upload->isValid()) {
$form_state->setValue('import_tarball', $file_upload->getRealPath());
return;
}
}
$form_state->setErrorByName('import_tarball', $this->t('The file could not be uploaded.'));
}
/**

View file

@ -2,6 +2,7 @@
namespace Drupal\config\Form;
use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
use Drupal\Component\Serialization\Yaml;
use Drupal\config\StorageReplaceDataWrapper;
use Drupal\Core\Config\ConfigImporter;
@ -281,8 +282,13 @@ class ConfigSingleImportForm extends ConfirmFormBase {
return;
}
// Decode the submitted import.
$data = Yaml::decode($form_state->getValue('import'));
try {
// Decode the submitted import.
$data = Yaml::decode($form_state->getValue('import'));
}
catch (InvalidDataTypeException $e) {
$form_state->setErrorByName('import', $this->t('The import failed with the following message: %message', ['%message' => $e->getMessage()]));
}
// Validate for config entities.
if ($form_state->getValue('config_type') !== 'system.simple') {
@ -388,7 +394,7 @@ class ConfigSingleImportForm extends ConfirmFormBase {
if ($config_importer->alreadyImporting()) {
drupal_set_message($this->t('Another request may be importing configuration already.'), 'error');
}
else{
else {
try {
$sync_steps = $config_importer->initialize();
$batch = [

View file

@ -330,7 +330,7 @@ class ConfigSync extends FormBase {
if ($config_importer->alreadyImporting()) {
drupal_set_message($this->t('Another request may be synchronizing configuration already.'));
}
else{
else {
try {
$sync_steps = $config_importer->initialize();
$batch = array(
@ -411,5 +411,4 @@ class ConfigSync extends FormBase {
}
}
}

View file

@ -196,4 +196,5 @@ class StorageReplaceDataWrapper implements StorageInterface {
$this->replacementData[$this->collection][$name] = $data;
return $this;
}
}

View file

@ -195,7 +195,8 @@ class ConfigEntityTest extends WebTestBase {
try {
$same_id->save();
$this->fail('Not possible to overwrite an entity entity.');
} catch (EntityStorageException $e) {
}
catch (EntityStorageException $e) {
$this->pass('Not possible to overwrite an entity entity.');
}

View file

@ -226,7 +226,7 @@ class ConfigExportImportUITest extends WebTestBase {
// Export the configuration.
$this->drupalPostForm('admin/config/development/configuration/full/export', array(), 'Export');
$this->tarball = $this->getRawContent();
$filename = file_directory_temp() .'/' . $this->randomMachineName();
$filename = file_directory_temp() . '/' . $this->randomMachineName();
file_put_contents($filename, $this->tarball);
// Set up the active storage collections to test import.

View file

@ -60,7 +60,7 @@ class ConfigImportAllTest extends ModuleTestBase {
\Drupal::service('module_installer')->install(array_keys($all_modules));
$this->assertModules(array_keys($all_modules), TRUE);
foreach($all_modules as $module => $info) {
foreach ($all_modules as $module => $info) {
$this->assertModuleConfig($module);
$this->assertModuleTablesExist($module);
}
@ -118,7 +118,7 @@ class ConfigImportAllTest extends ModuleTestBase {
\Drupal::service('module_installer')->uninstall(array_keys($modules_to_uninstall));
$this->assertModules(array_keys($modules_to_uninstall), FALSE);
foreach($modules_to_uninstall as $module => $info) {
foreach ($modules_to_uninstall as $module => $info) {
$this->assertNoModuleConfig($module);
$this->assertModuleTablesDoNotExist($module);
}
@ -133,7 +133,7 @@ class ConfigImportAllTest extends ModuleTestBase {
// Check that all modules that were uninstalled are now reinstalled.
$this->assertModules(array_keys($modules_to_uninstall), TRUE);
foreach($modules_to_uninstall as $module => $info) {
foreach ($modules_to_uninstall as $module => $info) {
$this->assertModuleConfig($module);
$this->assertModuleTablesExist($module);
}
@ -157,4 +157,5 @@ class ConfigImportAllTest extends ModuleTestBase {
$this->assertConfigSchema($typed_config, $name, $config->get());
}
}
}

View file

@ -49,7 +49,7 @@ class ConfigInstallProfileOverrideTest extends WebTestBase {
// Verify that the original data matches. We have to read the module config
// file directly, because the install profile default system.cron.yml
// configuration file was used to create the active configuration.
$config_dir = drupal_get_path('module', 'system') . '/'. InstallStorage::CONFIG_INSTALL_DIRECTORY;
$config_dir = drupal_get_path('module', 'system') . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
$this->assertTrue(is_dir($config_dir));
$source_storage = new FileStorage($config_dir);
$data = $source_storage->read($config_name);

View file

@ -187,4 +187,5 @@ class ConfigInstallWebTest extends WebTestBase {
$this->rebuildContainer();
$this->assertTrue(entity_load('config_test', 'other_module_test_with_dependency'), 'The config_test.dynamic.other_module_test_with_dependency configuration has been created during install.');
}
}

View file

@ -37,6 +37,16 @@ class ConfigSingleImportExportTest extends WebTestBase {
$uuid = \Drupal::service('uuid');
$this->drupalLogin($this->drupalCreateUser(array('import configuration')));
// Attempt an import with invalid YAML.
$edit = [
'config_type' => 'action',
'import' => '{{{',
];
$this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import'));
$this->assertText('The import failed with the following message: Malformed inline YAML string ({{{) at line 1 (near &quot;{{{&quot;)');
$import = <<<EOD
label: First
weight: 0

View file

@ -54,4 +54,5 @@ class EventSubscriber implements EventSubscriberInterface {
$events[ConfigEvents::RENAME][] = array('configEventRecorder');
return $events;
}
}

View file

@ -112,7 +112,7 @@ class ConfigMapperManager extends DefaultPluginManager implements ConfigMapperMa
*/
public function getMappers(RouteCollection $collection = NULL) {
$mappers = array();
foreach($this->getDefinitions() as $id => $definition) {
foreach ($this->getDefinitions() as $id => $definition) {
$mappers[$id] = $this->createInstance($id);
if ($collection) {
$mappers[$id]->setRouteCollection($collection);

View file

@ -456,7 +456,7 @@ class ConfigTranslationUiTest extends WebTestBase {
'medium' => 'Default medium date',
'custom_medium' => 'Custom medium date',
);
foreach($formats as $id => $label) {
foreach ($formats as $id => $label) {
$translation_base_url = 'admin/config/regional/date-time/formats/manage/' . $id . '/translate';
$this->drupalGet($translation_base_url);
@ -526,7 +526,7 @@ class ConfigTranslationUiTest extends WebTestBase {
$this->drupalGet('admin/config/people/accounts/translate/fr/edit');
foreach ($edit as $key => $value) {
// Check the translations appear in the right field type as well.
$xpath = '//' . (strpos($key, '[body]') ? 'textarea' : 'input') . '[@name="'. $key . '"]';
$xpath = '//' . (strpos($key, '[body]') ? 'textarea' : 'input') . '[@name="' . $key . '"]';
$this->assertFieldByXPath($xpath, $value);
}
// Check that labels for email settings appear.

View file

@ -440,7 +440,8 @@ class ConfigNamesMapperTest extends UnitTestCase {
$this->configNamesMapper->getLangcode();
$this->fail();
}
catch (\RuntimeException $e) {}
catch (\RuntimeException $e) {
}
}
/**

View file

@ -19,4 +19,5 @@ class ContactMessageAccessControlHandler extends EntityAccessControlHandler {
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return AccessResult::allowedIfHasPermission($account, 'access site-wide contact form');
}
}

View file

@ -31,4 +31,5 @@ class ContactAuthenticatedUserTest extends WebTestBase {
// Ensure that there is no textfield for email.
$this->assertFalse($this->xpath('//input[@name=:name]', array(':name' => 'mail')));
}
}

View file

@ -256,7 +256,7 @@ class ContactSitewideTest extends WebTestBase {
// Find out in which row the form we want to add a field to is.
$i = 0;
foreach($this->xpath('//table/tbody/tr') as $row) {
foreach ($this->xpath('//table/tbody/tr') as $row) {
if (((string) $row->td[0]->a) == $label) {
break;
}

View file

@ -57,7 +57,7 @@ class ContactFieldsTest extends ViewTestBase {
public function testViewsData() {
// Test that the field is not exposed to views, since contact_message
// entities have no storage.
$table_name = 'contact_message__' . $this->fieldStorage->getName();
$table_name = 'contact_message__' . $this->fieldStorage->getName();
$data = $this->container->get('views.views_data')->get($table_name);
$this->assertFalse($data, 'The field is not exposed to Views.');
}

View file

@ -75,4 +75,5 @@ class ContentTranslationOverviewAccess implements AccessInterface {
// No opinion.
return AccessResult::neutral();
}
}

View file

@ -696,6 +696,9 @@ class ContentTranslationHandler implements ContentTranslationHandlerInterface, E
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity whose form is being altered.
*
* @return string|null
* The label of the entity, or NULL if there is no label defined.
*/
protected function entityFormTitle(EntityInterface $entity) {
return $entity->label();
@ -710,4 +713,5 @@ class ContentTranslationHandler implements ContentTranslationHandlerInterface, E
public static function getDefaultOwnerId() {
return \Drupal::currentUser()->id();
}
}

View file

@ -74,7 +74,6 @@ interface ContentTranslationManagerInterface {
* @returns bool
* TRUE if the specified bundle is translatable. If no bundle is provided
* returns TRUE if at least one of the entity bundles is translatable.
*
*/
public function isEnabled($entity_type_id, $bundle = NULL);

View file

@ -146,4 +146,5 @@ class ContentTranslationMetadataWrapper implements ContentTranslationMetadataWra
$this->translation->set($field_name, $value);
}
}
}

Some files were not shown because too many files have changed in this diff Show more