There can be situations when Drupal.settings differ from what JS code (e.g. in behaviors) expects. The example is AJAX request which replaces the page content and modifies Drupal.settings accordingly.

The code in locale.datepicker.js expect that Drupal.settings.jquery.ui.datepicker exists, but it can be absent for some reasons. I suggest to add checks before addressing it.

Files: 
CommentFileSizeAuthor
#4 D8-locale_datepicker_js_settings-2530052-4.patch671 bytesmaximpodorov
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 98,166 pass(es). View
#1 D7-locale_datepicker_js_settings-2530052-1.patch634 bytesmaximpodorov
PASSED: [[SimpleTest]]: [MySQL] 41,504 pass(es). View

Comments

maximpodorov’s picture

Status: Active » Needs review
FileSize
634 bytes
PASSED: [[SimpleTest]]: [MySQL] 41,504 pass(es). View
cilefen’s picture

Version: 7.x-dev » 8.0.x-dev
Status: Needs review » Needs work

Drupal 8 has practically the same code so if the same thing could happen, this must be fixed there first according to the backport policy.

cilefen’s picture

Issue tags: +JavaScript
maximpodorov’s picture

Status: Needs work » Needs review
FileSize
671 bytes
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 98,166 pass(es). View

This patch is for Drupal 8.

droplet’s picture

Status: Needs review » Needs work

Shouldn't it start as default value if no extra settings.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.