Hello,

I think I stumbled upon a clash between the clientside_validation (7.x.1-25) and hierarchical_select (7.x-3.0-alpha5) modules.

I made a content type containing an embedded field collection with unlimited occurrences and a terms reference field (2 deep) using hierarchical select.

If I add an entry to the field group, and then select a term (both levels) in the hierarchical select field, javascript returns an error "a.attributes is null" from somewhere deep within the jQuery library and the browser hangs.

As far as I have been able to follow the javascript flow, it appears that in the process of modifying the hierarchical select widget, attachbehaviours from the clientsideValidation module is invoked, but instead of using the "context" parameter passed to the function, in the following statement :

         if ($(context).find('#' + f).length || $(context).attr('id') == f) {
            update = true;
          }

the h-select Drupal.HierarchicalSelect.context() function is called and the jquery operations invoked from the statement above encounter the java error.
When the term is selected first and after that the field collection entries are added, there are no errors.

I put this message in the issue queue of both modules as I don't know how the clash should be resolved.
http://drupal.org/project/clientside_validation
http://drupal.org/project/hierarchical_select

CommentFileSizeAuthor
#2 604.jpg65.4 KBLeoDoms
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attiks’s picture

Version: 7.x-1.25 » 7.x-1.x-dev

Can you try the latest dev version of clientside_validation?

If that doesn't work you have a content type with a field collection and inside the field collection a HS? Or is the HS at the content type?

LeoDoms’s picture

FileSize
65.4 KB

Thanks for the response. I 'll see if I can get the dev version installed.
The HS is not part of the field collection, they are 2 separate fields. The screenshot shows the fields of the content type. The error reproduces when I add a field_604vragen instance first, then when I enter a value in the field_604dom, the javascript error comes up.

attiks’s picture

Assigned: Unassigned » Jelle_S
LeoDoms’s picture

I haven't been able to get the dev version installed yet, but did have the opportunity to test with the 1.31 revision and this produces the same javascript error and "hanging" hourglass.

attiks’s picture

Not a real solution, but we added an option to exclude fields from clientside validation, added in the latest dev version, see also #1525360: Exclude specific fields using the UI (core fields & webform components). Will try to find a proper solution later.

Jelle_S’s picture

Status: Active » Fixed

As far as I have been able to follow the javascript flow, it appears that in the process of modifying the hierarchical select widget, attachbehaviours from the clientsideValidation module is invoked, but instead of using the "context" parameter passed to the function, in the following statement :

         if ($(context).find('#' + f).length || $(context).attr('id') == f) {
            update = true;
          }

the h-select Drupal.HierarchicalSelect.context() function is called and the jquery operations invoked from the statement above encounter the java error.

The fact that it called the function wasn't the real problem (but thaks for debugging because it helped me a lot finding the problem)
The problem was that the HTML element returned by that function didn't have the 'id' attribute, and jQuery didn't like that appearantly. So I fixed it changing

$(context).attr('id') == f 

to

$(context).is('#'+f)

which is essentially the same, but here jQuery doesn't seem to mind that there's no id attribute.

Fixed in 6 and 7

LeoDoms’s picture

Great. I installed the latest v7 "dev" module at our site and our problems are resolved. Thanks !

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chevali’s picture

Hi, i am having the same Problem right now, i even clicked the remove from clientside validation but still on submit it scrolls up and shows an error, my site is almost ready and this problem has taken too much time from me.

hierarchical_select 7.x-3.0-alpha5+9-dev (2012-Jun-16)
clientside_validation 7.x-1.37+20-dev (2013-Jun-07)

i just want the client side validation to not validate my HS field.

Best regards,
F.

attiks’s picture

Can you please create a new issues, this one is closed for a long time.

Did you create custom settings for the form to exclude clientside validation?