Into misc/drupal.js JS create a cookie but this ignore domain and path settings available into settings.php.

Attached patch correctly set path and domain for has_js cookie.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, has_js_path_domain-.diff, failed testing.

mavimo’s picture

Status: Needs work » Needs review
FileSize
2.44 KB

repatched

moshe weitzman’s picture

Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community

looks good

sun’s picture

Status: Reviewed & tested by the community » Needs work
+++ includes/common.inc	6 Jul 2010 14:41:11 -0000
@@ -3615,7 +3616,10 @@ function drupal_add_js($data = NULL, $op
+              'cookieDomain' => isset($cookie_domain) ? $cookie_domain : '',

If $cookie_domain is empty, then we don't want to output that JS setting.

+++ misc/drupal.js	6 Jul 2010 14:41:11 -0000
@@ -329,7 +329,7 @@ Drupal.ajaxError = function (xmlhttp, ur
-document.cookie = 'has_js=1; path=/';
+document.cookie = 'has_js=1; path=' + (Drupal.settings.basePath ? Drupal.settings.basePath : '/') + (Drupal.settings.cookieDomain ? '; domain=' + Drupal.settings.cookieDomain + ' ' : ' ');

1) The Drupal.settings.PROPERTY checks have to be typeof Drupal.settings.PROPERTY checks.

2) At first sight, I don't understand why the code appends a blank space. If that space is required, then there should be an inline comment, so as to prevent the next developer from removing it.

Powered by Dreditor.

treksler’s picture

why do we want this patch? it exacerbates the problem in http://drupal.org/node/229825 by spewing more has_js cookies instead of just one for the '/' path which is bad enough and needs to go away.