Update to Drupal 8.0.3. For more information, see https://www.drupal.org/drupal-8.0.3-release-notes

This commit is contained in:
Pantheon Automation 2016-02-03 14:56:31 -08:00 committed by Greg Anderson
parent 10f9f7fbde
commit 9db4fae9a7
202 changed files with 3806 additions and 760 deletions

View file

@ -35,10 +35,11 @@ function hook_ckeditor_plugin_info_alter(array &$plugins) {
* iframe versions of CKEditor.
*
* Front-end themes (and base themes) can easily specify CSS files to be used in
* iframe instances of CKEditor through an entry in their .info file:
* iframe instances of CKEditor through an entry in their .info.yml file:
*
* @code
* ckeditor_stylesheets[] = css/ckeditor-iframe.css
* ckeditor_stylesheets:
* - css/ckeditor-iframe.css
* @endcode
*
* @param array &$css

View file

@ -19,6 +19,7 @@ use Drupal\Component\Annotation\Plugin;
* @see \Drupal\ckeditor\CKEditorPluginInterface
* @see \Drupal\ckeditor\CKEditorPluginBase
* @see \Drupal\ckeditor\CKEditorPluginManager
* @see hook_ckeditor_plugin_info_alter()
* @see plugin_api
*
* @Annotation

View file

@ -17,11 +17,11 @@ use Drupal\editor\Entity\Editor;
* than the one provided by Drupal core is used. Most CKEditor plugins don't
* need to provide additional settings forms.
*
* This base assumes that your plugin has buttons that you want to be enabled
* through the toolbar builder UI. It is still possible to also implement the
* CKEditorPluginContextualInterface (for contextual enabling) and
* This base class assumes that your plugin has buttons that you want to be
* enabled through the toolbar builder UI. It is still possible to also
* implement the CKEditorPluginContextualInterface (for contextual enabling) and
* CKEditorPluginConfigurableInterface interfaces (for configuring plugin
* settings) though.
* settings).
*
* NOTE: the Drupal plugin ID should correspond to the CKEditor plugin name.
*

View file

@ -298,8 +298,11 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
);
// Finally, set Drupal-specific CKEditor settings.
$root_relative_file_url = function ($uri) {
return file_url_transform_relative(file_create_url($uri));
};
$settings += array(
'drupalExternalPlugins' => array_map('file_create_url', $external_plugin_files),
'drupalExternalPlugins' => array_map($root_relative_file_url, $external_plugin_files),
);
// Parse all CKEditor plugin JavaScript files for translations.
@ -421,6 +424,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
$this->moduleHandler->alter('ckeditor_css', $css, $editor);
$css = array_merge($css, _ckeditor_theme_css());
$css = array_map('file_create_url', $css);
$css = array_map('file_url_transform_relative', $css);
return array_values($css);
}

View file

@ -90,8 +90,8 @@ class CKEditorTest extends KernelTestBase {
'language' => 'en',
'stylesSet' => FALSE,
'drupalExternalPlugins' => array(
'drupalimage' => file_create_url('core/modules/ckeditor/js/plugins/drupalimage/plugin.js'),
'drupallink' => file_create_url('core/modules/ckeditor/js/plugins/drupallink/plugin.js'),
'drupalimage' => file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupalimage/plugin.js')),
'drupallink' => file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupallink/plugin.js')),
),
);
$expected_config = $this->castSafeStrings($expected_config);
@ -114,9 +114,9 @@ class CKEditorTest extends KernelTestBase {
$expected_config['toolbar'][0]['items'][] = 'Format';
$expected_config['format_tags'] = 'p;h2;h3;h4;h5;h6';
$expected_config['extraPlugins'] .= ',llama_contextual,llama_contextual_and_button';
$expected_config['drupalExternalPlugins']['llama_contextual'] = file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual.js');
$expected_config['drupalExternalPlugins']['llama_contextual_and_button'] = file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual_and_button.js');
$expected_config['contentsCss'][] = file_create_url('core/modules/ckeditor/tests/modules/ckeditor_test.css');
$expected_config['drupalExternalPlugins']['llama_contextual'] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual.js'));
$expected_config['drupalExternalPlugins']['llama_contextual_and_button'] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual_and_button.js'));
$expected_config['contentsCss'][] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/ckeditor_test.css'));
ksort($expected_config);
$this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.');
@ -261,15 +261,15 @@ class CKEditorTest extends KernelTestBase {
// Enable the editor_test module, which implements hook_ckeditor_css_alter().
$this->enableModules(array('ckeditor_test'));
$expected[] = file_create_url('core/modules/ckeditor/tests/modules/ckeditor_test.css');
$expected[] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/ckeditor_test.css'));
$this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a hook_ckeditor_css_alter() implementation exists.');
// Enable the Bartik theme, which specifies a CKEditor stylesheet.
\Drupal::service('theme_handler')->install(['bartik']);
$this->config('system.theme')->set('default', 'bartik')->save();
$expected[] = file_create_url('core/themes/bartik/css/base/elements.css');
$expected[] = file_create_url('core/themes/bartik/css/components/captions.css');
$expected[] = file_create_url('core/themes/bartik/css/components/table.css');
$expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/base/elements.css'));
$expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/captions.css'));
$expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/table.css'));
$this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a theme providing a CKEditor stylesheet exists.');
}
@ -478,8 +478,8 @@ class CKEditorTest extends KernelTestBase {
protected function getDefaultContentsCssConfig() {
return array(
file_create_url('core/modules/ckeditor/css/ckeditor-iframe.css'),
file_create_url('core/modules/system/css/components/align.module.css'),
file_url_transform_relative(file_create_url('core/modules/ckeditor/css/ckeditor-iframe.css')),
file_url_transform_relative(file_create_url('core/modules/system/css/components/align.module.css')),
);
}

View file

@ -57,7 +57,6 @@ class CKEditorToolbarButtonTest extends WebTestBase {
* Method tests CKEditor image buttons.
*/
public function testImageButtonDisplay() {
global $base_url;
$this->drupalLogin($this->admin_user);
// Install the Arabic language (which is RTL) and configure as the default.
@ -75,7 +74,7 @@ class CKEditorToolbarButtonTest extends WebTestBase {
$json_encode = function($html) {
return trim(Json::encode($html), '"');
};
$markup = $json_encode($base_url . '/core/modules/ckeditor/js/plugins/drupalimage/image.png');
$markup = $json_encode(file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupalimage/image.png')));
$this->assertRaw($markup);
}