From f5955bfeadd20ca4567a32824a274b7347f8cb65 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 24 Sep 2012 10:15:37 +0100 Subject: [PATCH 1/6] Issue #1785436 by Boobaa: Fixed Submission of #required elements without #title and empty value does not display any error. --- core/includes/form.inc | 2 +- .../lib/Drupal/system/Tests/Form/FormTest.php | 32 +++++++++++++++++++ .../tests/modules/form_test/form_test.module | 27 ++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/core/includes/form.inc b/core/includes/form.inc index 29bce0019be..5f580fb4584 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -4590,7 +4590,7 @@ function _form_set_class(&$element, $class = array()) { $element['#attributes']['required'] = 'required'; $element['#attributes']['aria-required'] = 'true'; } - if (isset($element['#parents']) && form_get_error($element)) { + if (isset($element['#parents']) && form_get_error($element) !== NULL) { $element['#attributes']['class'][] = 'error'; } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php index 3fc5bd42df3..2586aa33d62 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php @@ -219,6 +219,38 @@ class FormTest extends WebTestBase { $this->assertRaw("The form_test_validate_required_form form was submitted successfully.", 'Validation form submitted successfully.'); } + /** + * Tests validation for required textfield element without title. + * + * Submits a test form containing a textfield form element without title. + * The form is submitted twice, first without value for the required field + * and then with value. Each submission is checked for relevant error + * messages. + * + * @see form_test_validate_required_form_no_title() + */ + function testRequiredTextfieldNoTitle() { + $form = $form_state = array(); + $form = form_test_validate_required_form_no_title($form, $form_state); + + // Attempt to submit the form with no required field set. + $edit = array(); + $this->drupalPost('form-test/validate-required-no-title', $edit, 'Submit'); + $this->assertNoRaw("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.'); + + // Check the page for the error class on the textfield. + $this->assertFieldByXPath('//input[contains(@class, "error")]', FALSE, 'Error input form element class found.'); + + // Submit again with required fields set and verify that there are no + // error messages. + $edit = array( + 'textfield' => $this->randomString(), + ); + $this->drupalPost(NULL, $edit, 'Submit'); + $this->assertNoFieldByXpath('//input[contains(@class, "error")]', FALSE, 'No error input form element class found.'); + $this->assertRaw("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.'); + } + /** * Test default value handling for checkboxes. * diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module index 45b3cba2739..3c322a6ce04 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -30,6 +30,13 @@ function form_test_menu() { 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); + $items['form-test/validate-required-no-title'] = array( + 'title' => 'Form #required validation without #title', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('form_test_validate_required_form_no_title'), + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); $items['form-test/limit-validation-errors'] = array( 'title' => 'Form validation with some error suppression', 'page callback' => 'drupal_get_form', @@ -488,6 +495,26 @@ function form_test_validate_required_form_submit($form, &$form_state) { drupal_set_message('The form_test_validate_required_form form was submitted successfully.'); } +/** + * Form constructor to test the #required property without #title. + */ +function form_test_validate_required_form_no_title($form, &$form_state) { + $form['textfield'] = array( + '#type' => 'textfield', + '#required' => TRUE, + ); + $form['actions'] = array('#type' => 'actions'); + $form['actions']['submit'] = array('#type' => 'submit', '#value' => 'Submit'); + return $form; +} + +/** + * Form submission handler for form_test_validate_required_form_no_title(). + */ +function form_test_validate_required_form_no_title_submit($form, &$form_state) { + drupal_set_message('The form_test_validate_required_form_no_title form was submitted successfully.'); +} + /** * Builds a simple form with a button triggering partial validation. */ From 3e854432e326c63d767e6fdce444d62322b8ead2 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 24 Sep 2012 10:17:08 +0100 Subject: [PATCH 2/6] Issue #1786124 by xjm: Clean up node access pager test. --- .../Drupal/node/Tests/NodeAccessPagerTest.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php index 640f9e077ac..bf8f8456de8 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php @@ -62,24 +62,24 @@ class NodeAccessPagerTest extends WebTestBase { // View the node page. With the default 50 comments per page there should // be two pages (0, 1) but no third (2) page. $this->drupalGet('node/' . $node->nid); - $this->assertText($node->label(), t('Node title found.')); - $this->assertText(t('Comments'), t('Has a comments section.')); - $this->assertRaw('page=1', t('Secound page exists.')); - $this->assertNoRaw('page=2', t('No third page exists.')); + $this->assertText($node->label()); + $this->assertText(t('Comments')); + $this->assertRaw('page=1'); + $this->assertNoRaw('page=2'); } /** * Tests the forum node pager for nodes with multiple grants per realm. */ public function testForumPager() { - // Lookup the forums vocabulary vid. + // Look up the forums vocabulary ID. $vid = config('forum.settings')->get('vocabulary'); - $this->assertTrue($vid, t('Forum navigation vocabulary found.')); + $this->assertTrue($vid, 'Forum navigation vocabulary ID is set.'); - // Lookup the general discussion term. + // Look up the general discussion term. $tree = taxonomy_get_tree($vid, 0, 1); $tid = reset($tree)->tid; - $this->assertTrue($tid, t('General discussion term found.')); + $this->assertTrue($tid, 'General discussion term is found in the forum vocabulary.'); // Create 30 nodes. for ($i = 0; $i < 30; $i++) { @@ -98,7 +98,7 @@ class NodeAccessPagerTest extends WebTestBase { // page there should be two pages for 30 nodes, no more. $this->drupalLogin($this->web_user); $this->drupalGet('forum/' . $tid); - $this->assertRaw('page=1', t('Secound page exists.')); - $this->assertNoRaw('page=2', t('No third page exists.')); + $this->assertRaw('page=1'); + $this->assertNoRaw('page=2'); } } From 67c61efc92d31af17785754d0a681e70b23bcd22 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 24 Sep 2012 10:19:25 +0100 Subject: [PATCH 3/6] Issue #1436814 by gary4gar, kid_icarus, webchick, droplet, andypost: Fixed Fast 404 'Not found' pages are missing a doctype. --- core/includes/bootstrap.inc | 2 +- sites/default/default.settings.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 8235b9f94c2..3f2a085b289 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2564,7 +2564,7 @@ function drupal_fast_404() { $fast_paths = variable_get('404_fast_paths', FALSE); if ($fast_paths && preg_match($fast_paths, request_path())) { drupal_add_http_header('Status', '404 Not Found'); - $fast_404_html = variable_get('404_fast_html', '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'); + $fast_404_html = variable_get('404_fast_html', '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'); // Replace @path in the variable with the page path. print strtr($fast_404_html, array('@path' => check_plain(request_uri()))); exit; diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 8e95dba25f6..deace30e1ff 100755 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -519,7 +519,7 @@ ini_set('session.cookie_lifetime', 2000000); */ $conf['404_fast_paths_exclude'] = '/\/(?:styles)\//'; $conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -$conf['404_fast_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +$conf['404_fast_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; /** * By default, fast 404s are returned as part of the normal page request From 2c026bb857f9c17a877aa0fa7009fa605315bf77 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 24 Sep 2012 10:23:59 +0100 Subject: [PATCH 4/6] Issue #466576 by gagarine, jackbravo, tim.plunkett, sheise, jamesm6162: Increase Block Title Length. --- core/modules/block/block.admin.inc | 3 ++- core/modules/block/block.install | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc index 848298f00d2..cc4bd716354 100644 --- a/core/modules/block/block.admin.inc +++ b/core/modules/block/block.admin.inc @@ -285,7 +285,8 @@ function block_admin_configure($form, &$form_state, $module, $delta) { $form['settings']['title'] = array( '#type' => 'textfield', '#title' => t('Block title'), - '#maxlength' => 64, + '#maxlength' => 255, + '#size' => 60, '#description' => $block->module == 'block' ? t('The title of the block as shown to the user.') : t('Override the default title for the block. Use !placeholder to display no title, or leave blank to use the default block title.', array('!placeholder' => '<none>')), '#default_value' => isset($block->title) ? $block->title : '', '#weight' => -19, diff --git a/core/modules/block/block.install b/core/modules/block/block.install index 4c5149b85fc..09ba522ca50 100644 --- a/core/modules/block/block.install +++ b/core/modules/block/block.install @@ -79,7 +79,7 @@ function block_schema() { ), 'title' => array( 'type' => 'varchar', - 'length' => 64, + 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => 'Custom title for the block. (Empty string will use block default title, will remove the title, text will cause block to use specified title.)', @@ -311,6 +311,21 @@ function block_update_8002() { ->execute(); } +/** + * Increase {block}.title length to 255 characters. + */ +function block_update_8003() { + db_change_field('block', 'title', 'title', array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Custom title for the block. (Empty string will use block default title, will remove the title, text will cause block to use specified title.)', + 'translatable' => TRUE, + ) + ); +} + /** * @} End of "addtogroup updates-7.x-to-8.x". * The next series of updates should start at 9000. From e2743fdb8957ad05b995412242f86d2e4ad1d7b0 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 24 Sep 2012 10:33:31 +0100 Subject: [PATCH 5/6] Issue #1575060 by andypost, mcjim, nod_: Fixed ajax_html_ids() are broken for forms with file element (encoding=multipart/form-data). --- core/includes/common.inc | 3 ++- core/misc/ajax.js | 11 +++++++---- .../simpletest/lib/Drupal/simpletest/WebTestBase.php | 7 +++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/includes/common.inc b/core/includes/common.inc index e7ebd1f4cdd..e8ae4786cda 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3528,7 +3528,8 @@ function drupal_html_id($id) { // requested id. $_POST['ajax_html_ids'] contains the ids as they were // returned by this function, potentially with the appended counter, so // we parse that to reconstruct the $seen_ids array. - foreach ($_POST['ajax_html_ids'] as $seen_id) { + $ajax_html_ids = explode(' ', $_POST['ajax_html_ids']); + foreach ($ajax_html_ids as $seen_id) { // We rely on '--' being used solely for separating a base id from the // counter, which this function ensures when returning an id. $parts = explode('--', $seen_id, 2); diff --git a/core/misc/ajax.js b/core/misc/ajax.js index 94bfb890fb5..8e935ed266d 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -284,10 +284,13 @@ Drupal.ajax.prototype.beforeSerialize = function (element, options) { // Prevent duplicate HTML ids in the returned markup. // @see drupal_html_id() - options.data['ajax_html_ids[]'] = []; - $('[id]').each(function () { - options.data['ajax_html_ids[]'].push(this.id); - }); + var ids = document.querySelectorAll('[id]'); + var ajaxHtmlIds = []; + for (var i = 0, il = ids.length; i < il; i++) { + ajaxHtmlIds.push(ids[i].id); + } + // Join IDs to minimize request size. + options.data.ajax_html_ids = ajaxHtmlIds.join(' '); // Allow Drupal to return new JavaScript and CSS files to load without // returning the ones already loaded. diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 385d6f4586a..cc54b6739f4 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -1284,9 +1284,12 @@ abstract class WebTestBase extends TestBase { $extra_post .= '&' . urlencode($key) . '=' . urlencode($value); } } + $ajax_html_ids = array(); foreach ($this->xpath('//*[@id]') as $element) { - $id = (string) $element['id']; - $extra_post .= '&' . urlencode('ajax_html_ids[]') . '=' . urlencode($id); + $ajax_html_ids[] = (string) $element['id']; + } + if (!empty($ajax_html_ids)) { + $extra_post .= '&' . urlencode('ajax_html_ids') . '=' . urlencode(implode(' ', $ajax_html_ids)); } if (isset($drupal_settings['ajaxPageState'])) { $extra_post .= '&' . urlencode('ajax_page_state[theme]') . '=' . urlencode($drupal_settings['ajaxPageState']['theme']); From bd07cedb749efc0bd03e7802e9deb79ce39c69a5 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 24 Sep 2012 14:12:09 +0100 Subject: [PATCH 6/6] Issue #1760548 by nod_: Remove dependency on jQuery drupal.js? for JS settings. --- core/includes/common.inc | 12 ++++----- core/misc/drupal.js | 19 ++++++++------ core/modules/color/color.module | 2 +- core/modules/field_ui/field_ui.module | 2 +- core/modules/file/file.module | 2 +- core/modules/locale/locale.module | 2 +- core/modules/node/node.module | 2 +- core/modules/overlay/overlay.module | 4 +-- .../lib/Drupal/simpletest/WebTestBase.php | 2 +- core/modules/simpletest/simpletest.module | 2 +- core/modules/statistics/statistics.module | 2 +- .../system/Tests/Common/JavaScriptTest.php | 10 +++---- core/modules/system/system.module | 26 ++++++++----------- .../modules/common_test/common_test.module | 2 +- core/modules/taxonomy/taxonomy.module | 2 +- core/modules/toolbar/toolbar.module | 2 +- core/modules/user/user.module | 2 +- 17 files changed, 46 insertions(+), 49 deletions(-) diff --git a/core/includes/common.inc b/core/includes/common.inc index e8ae4786cda..d0e9a2fd3d4 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -76,6 +76,11 @@ const CSS_DEFAULT = 0; */ const CSS_THEME = 100; +/** + * The default group for JavaScript settings added to the page. + */ +const JS_SETTING = -200; + /** * The default group for JavaScript and jQuery libraries added to the page. */ @@ -91,11 +96,6 @@ const JS_DEFAULT = 0; */ const JS_THEME = 100; -/** - * The default group for JavaScript settings added to the page. - */ -const JS_SETTING = 200; - /** * Error code indicating that the request exceeded the specified timeout. * @@ -4038,7 +4038,7 @@ function drupal_pre_render_scripts($elements) { switch ($item['type']) { case 'setting': $element['#value_prefix'] = $embed_prefix; - $element['#value'] = 'jQuery.extend(Drupal.settings, ' . drupal_json_encode(drupal_array_merge_deep_array($item['data'])) . ");"; + $element['#value'] = 'var drupalSettings = ' . drupal_json_encode(drupal_array_merge_deep_array($item['data'])) . ";"; $element['#value_suffix'] = $embed_suffix; break; diff --git a/core/misc/drupal.js b/core/misc/drupal.js index 8bbddc2370b..627e264a784 100644 --- a/core/misc/drupal.js +++ b/core/misc/drupal.js @@ -1,14 +1,17 @@ -var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} }; +var Drupal = Drupal || { 'behaviors': {}, 'locale': {} }; // Allow other JavaScript libraries to use $. jQuery.noConflict(); // JavaScript should be made compatible with libraries other than jQuery by // wrapping it in an anonymous closure. -(function ($, Drupal, window, document, undefined) { +(function ($, Drupal, drupalSettings) { "use strict"; +// Populate Drupal.settings with the drupalSettings variable. +Drupal.settings = drupalSettings; + /** * Custom error type thrown after attach/detach if one or more behaviors failed. * @@ -71,7 +74,7 @@ DrupalBehaviorError.prototype = new Error(); */ Drupal.attachBehaviors = function (context, settings) { context = context || document; - settings = settings || Drupal.settings; + settings = settings || drupalSettings; var i, errors = [], behaviors = Drupal.behaviors; // Execute all of them. for (i in behaviors) { @@ -133,7 +136,7 @@ Drupal.attachBehaviors = function (context, settings) { */ Drupal.detachBehaviors = function (context, settings, trigger) { context = context || document; - settings = settings || Drupal.settings; + settings = settings || drupalSettings; trigger = trigger || 'unload'; var i, errors = [], behaviors = Drupal.behaviors; // Execute all of them. @@ -159,7 +162,7 @@ Drupal.detachBehaviors = function (context, settings, trigger) { * @todo Temporary solution for the mobile initiative. */ Drupal.checkWidthBreakpoint = function (width) { - width = width || Drupal.settings.widthBreakpoint || 640; + width = width || drupalSettings.widthBreakpoint || 640; return (document.documentElement.clientWidth > width); }; @@ -259,7 +262,7 @@ Drupal.t = function (str, args, options) { * Returns the URL to a Drupal page. */ Drupal.url = function (path) { - return Drupal.settings.basePath + Drupal.settings.scriptPath + path; + return drupalSettings.basePath + drupalSettings.scriptPath + path; }; /** @@ -434,7 +437,7 @@ $('html').addClass('js'); //Attach all behaviors. $(function () { - Drupal.attachBehaviors(document, Drupal.settings); + Drupal.attachBehaviors(document, drupalSettings); }); /** @@ -455,4 +458,4 @@ $.extend(Drupal.theme, { } }); -})(jQuery, Drupal, this, this.document); +})(jQuery, Drupal, window.drupalSettings); diff --git a/core/modules/color/color.module b/core/modules/color/color.module index d4ca6ca554a..56c04cf4090 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -771,7 +771,7 @@ function color_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), array('system', 'jquery.once'), ), ); diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 63cf18bfed8..2efc07cf4eb 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -397,7 +397,7 @@ function field_ui_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), array('system', 'jquery.once'), ), ); diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 447871b0710..0f6cb64738f 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -1710,7 +1710,7 @@ function file_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), ), ); diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 86689acc2f2..a210a9e1d99 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -466,7 +466,7 @@ function locale_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), ), ); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index bca8d9b6644..573d286788e 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -4054,7 +4054,7 @@ function node_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), array('system', 'drupal.form'), ), ); diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index e03c032b4a2..3ae575c6641 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -213,7 +213,7 @@ function overlay_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), array('system', 'jquery.ui.core'), array('system', 'jquery.bbq'), ), @@ -232,7 +232,7 @@ function overlay_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), array('system', 'jquery.once'), ), ); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index cc54b6739f4..b293c29279a 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -1988,7 +1988,7 @@ abstract class WebTestBase extends TestBase { $this->plainTextContent = FALSE; $this->elements = FALSE; $this->drupalSettings = array(); - if (preg_match('/jQuery\.extend\(Drupal\.settings, (.*?)\);/', $content, $matches)) { + if (preg_match('/var drupalSettings = (.*?);/', $content, $matches)) { $this->drupalSettings = drupal_json_decode($matches[1]); } } diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index f216339f1d5..dd5ee4dee55 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -551,7 +551,7 @@ function simpletest_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), array('system', 'jquery.once'), array('system', 'drupal.tableselect'), ), diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 72a1efbe8bb..8469e52e2aa 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -474,7 +474,7 @@ function statistics_library_info() { 'dependencies' => array( array('system', 'jquery'), array('system', 'drupal'), - array('system', 'drupal.settings'), + array('system', 'drupalSettings'), ), ); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php index 872aaa7e7a0..d2f39bb80cc 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php @@ -76,7 +76,7 @@ class JavaScriptTest extends WebTestBase { */ function testAddSetting() { // Add a file in order to test default settings. - drupal_add_library('system', 'drupal.settings'); + drupal_add_library('system', 'drupalSettings'); $javascript = drupal_add_js(); $last_settings = reset($javascript['settings']['data']); $this->assertTrue($last_settings['currentPath'], 'The current path JavaScript setting is set correctly.'); @@ -136,15 +136,13 @@ class JavaScriptTest extends WebTestBase { * Test drupal_get_js() for JavaScript settings. */ function testHeaderSetting() { - drupal_add_library('system', 'drupal.settings'); + drupal_add_library('system', 'drupalSettings'); $javascript = drupal_get_js('header'); $this->assertTrue(strpos($javascript, 'basePath') > 0, 'Rendered JavaScript header returns basePath setting.'); $this->assertTrue(strpos($javascript, 'scriptPath') > 0, 'Rendered JavaScript header returns scriptPath setting.'); $this->assertTrue(strpos($javascript, 'pathPrefix') > 0, 'Rendered JavaScript header returns pathPrefix setting.'); $this->assertTrue(strpos($javascript, 'currentPath') > 0, 'Rendered JavaScript header returns currentPath setting.'); - $this->assertTrue(strpos($javascript, 'core/misc/drupal.js') > 0, 'Rendered JavaScript header includes Drupal.js.'); - $this->assertTrue(strpos($javascript, 'core/misc/jquery.js') > 0, 'Rendered JavaScript header includes jQuery.'); // Only the second of these two entries should appear in Drupal.settings. drupal_add_js(array('commonTest' => 'commonTestShouldNotAppear'), 'setting'); @@ -173,11 +171,11 @@ class JavaScriptTest extends WebTestBase { $this->assertTrue($associative_array_override, t('drupal_add_js() correctly overrides settings within an associative array.')); // Check in a rendered page. $this->drupalGet('common-test/query-string'); - $this->assertPattern('@