Im not sure where to open this issue with the Client Side Validation module or here.

Console error.

       $.each(Drupal.settings.clientsideValidation.forms, function (f) {
          if ($(context).find('#' + f).length || $(context).is('#' + f)) {
            update = true;
          }
        });

When authcache runs authcacheP13nReplaceWith the above Client Side Validation JS throws the following error.

TypeError: t.getAttribute is not a function. (In 't.getAttribute("id")', 't.getAttribute' is undefined)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lathan created an issue. See original summary.

lathan’s picture

Maybe just note this some where... I made a choice between the two and was thankfully easy enough to remove clientside validation from my stack.

znerol’s picture

Nice catch. I think that might be a combination of bugs in Authcache and Client Side Validation.

  1. Authcache probably should only call Drupal.attachBehaviors for HTML elements. It looks like it also tries to attach text nodes.
  2. Client Side Validation shouldn't use $(context).find(selector) but rather $(selector, context).

Patch attached for the first problem. Do you mind applying the patch and then report back whether it resolves the incompatibility?

lathan’s picture

@znerol I owe you a beer, I will get back to you at the soonest.

lathan’s picture

@znerol Still falling over for me.

znerol’s picture

Interesting. Do you mind checking which data is causing that trouble?

Maybe add a console.log statement in authcache_p13n.js:

$elem.each(function() {
  console.log(this) // <- add this line to debug or set a breakpoint and examine the contents of the this-variable.
  Drupal.attachBehaviors(this);
});
znerol’s picture

Status: Needs review » Postponed (maintainer needs more info)

I tried to reproduce this problem with Chrome and Firefox to no avail. Which browser/OS do you use? Is there any standard Drupal form where the problem occurs (e.g., the contact form or the comment form)?

lathan’s picture

@znerol sorry crazy week have not had a gap to look into this, hope to over next day or two.

znerol’s picture

Any updates on this?