Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm sorry for the short report, anyway here is the story:
I'm using reference option limit module to control the value of term reference field by another term reference field.
As described in the module description, I have three fields in chain ( Country, City, Region).
Values of "City" are controlled by the choice made in "Country", and values of "Region" are controlled by the choice made in "City". All three fields are exposed as filters in a view, so the sequence is like this:
A user chooses an option from the "country" dropdown list, then an Ajax request is being made, and only cities related to the selected country exist in the city list.
Then the user chooses a city and this will make the same request to populate the related regions of the selected city to the "region" dropdown list.
I followed your instructions and patched views 3.7 and added the selective "country field", and the list of Countries are now trimmed to the actual used terms, now this is fine, but when I choose a country I get these error messages:
Location http://mysite.com/en/system/ajax
Message Invalid form POST data.
Severity warning
Location http://mysite.com/en/system/ajax
Message Notice: Undefined index: form_build_id in ajax_get_form() (line 321 of /path/to/mysite/includes/ajax.inc).
Severity notice
Even though I can't add selective City and/or Region filters because they break the option limit part.
Asides from the bug, ¿do you really need the Reference Option Limit module? I mean, if the three filters where selective, changing one of them will actually affect and refresh the contents of the other two. You can use Better Exposed Filter to automatically trigger that refresh.
I am intrigued by the "Invalid Form POST data" warning, ¿can you get a request dump using Fiddler of what data is being POSTed?
Yep, Reference option limit is a must for my website, it is different than "Better exposed filter module".
It hide all options of the controlled fields until a choice has been selected within the controller field.
As for fiddler, I have never used that before and I don't know how to use it. but if you want me to do it I will.
I ran into a similar issue without using the Reference Option Limit, but it was unrelated to this module. When ajaxing form elements inside the Views Exposed Filters there are some important form elements like the build_id & token that are not passed along. You can find more information and a patch/workaround here - Ajax attached to exposed filters in form_alter doesn't trigger callback
Comments
Comment #1
david_garcia CreditAttribution: david_garcia commentedPlease, follow the basic bug reporting guidelines:
https://drupal.org/contribute/testing
It is very difficult to trim down the problem with the provided information. Be specific, and provide tools and steps to replicate the issue.
Comment #2
mas0h CreditAttribution: mas0h commentedI'm sorry for the short report, anyway here is the story:
I'm using reference option limit module to control the value of term reference field by another term reference field.
As described in the module description, I have three fields in chain ( Country, City, Region).
Values of "City" are controlled by the choice made in "Country", and values of "Region" are controlled by the choice made in "City". All three fields are exposed as filters in a view, so the sequence is like this:
A user chooses an option from the "country" dropdown list, then an Ajax request is being made, and only cities related to the selected country exist in the city list.
Then the user chooses a city and this will make the same request to populate the related regions of the selected city to the "region" dropdown list.
I followed your instructions and patched views 3.7 and added the selective "country field", and the list of Countries are now trimmed to the actual used terms, now this is fine, but when I choose a country I get these error messages:
Even though I can't add selective City and/or Region filters because they break the option limit part.
Comment #3
david_garcia CreditAttribution: david_garcia commentedAsides from the bug, ¿do you really need the Reference Option Limit module? I mean, if the three filters where selective, changing one of them will actually affect and refresh the contents of the other two. You can use Better Exposed Filter to automatically trigger that refresh.
I am intrigued by the "Invalid Form POST data" warning, ¿can you get a request dump using Fiddler of what data is being POSTed?
Greetings,
Comment #4
mas0h CreditAttribution: mas0h commentedYep, Reference option limit is a must for my website, it is different than "Better exposed filter module".
It hide all options of the controlled fields until a choice has been selected within the controller field.
As for fiddler, I have never used that before and I don't know how to use it. but if you want me to do it I will.
Comment #5
mas0h CreditAttribution: mas0h commentedI tried to use fiddler but I didn't know how to do it.
Comment #6
mas0h CreditAttribution: mas0h commentedGreetings,
I have now the dump of the POST request, how can I send it to you?
I don't want to expose my website data in public.
Thanks!
Comment #7
nsciaccaI ran into a similar issue without using the Reference Option Limit, but it was unrelated to this module. When ajaxing form elements inside the Views Exposed Filters there are some important form elements like the build_id & token that are not passed along. You can find more information and a patch/workaround here - Ajax attached to exposed filters in form_alter doesn't trigger callback