I found a strange javascript bug on my Ubercart checkout page. I don't know why this bug was appeared just on this page (and why I can't reproduce it in Firefox), but it was provided exactly by DHTML Menu js code.

Here is Chrome console output:

Uncaught Syntax error, unrecognized expression: )

I had debugged this exception, and found the reason. If someone interested for more information, I will provide it.

Here is the code which provide bug:

  // Get cookie
  if (!effects.siblings) {
    var cookie = Drupal.dhtmlMenu.cookieGet();
    for (var i in cookie) {
      // If the cookie was not applied to the HTML code yet, do so now.
      var li = $('#dhtml_menu-' + cookie[i]).parents('li:first');
      if ($(li).hasClass('collapsed')) {
        Drupal.dhtmlMenu.toggleMenu(li);
      }
    }
  }

During debugging I found that this code do nothing at all.
For example, if I had two menu items expanded, cookieGet() returns "_menu-31605,_menu-31603". This is string value, and "for" cycle executes for each character.

May be this code works wrong, but DHTML Menu works fine without it. So, I suggest to remove mentioned code.

CommentFileSizeAuthor
#1 ubercart-order-pane-js-issue.patch696 bytesyogesh1110
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yogesh1110’s picture

Status: Active » Patch (to be ported)
FileSize
696 bytes

check this patch for the same

ShaneOnABike’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

I can confirm that this patch is in fact actually resolving the issue. This is a fairly serious issue as it's completely disabling the ability for people to use ubercart shipping calculations. Can we apply this patch? It seems to me that this is being used to determine whether a previous clicked state (collapsed or expanded) was done in the past through a cookie.

Also, can we apply this patch or fix the JS?

Cheers

yogesh1110’s picture

Status: Reviewed & tested by the community » Needs review
vuil’s picture