I have two custom Drupal modules moduleA and moduleB. moduleA has all the functions for Ajax calls i.e. ajax_example_dependent_dropdown_callback and _ajax_example_get_second_dropdown_options.  I create a content type in moduleB called content_type_b. I am using Ajax calls in moduleB to populate drop down in content_type_b.  While creating content for content_type_b, I try to choose a value from the drop down. The first time, it works fine. The second time I get an error saying "An Illegal choice has been selected. Please contact the administrator". All these events happen before a node insert.  When I looked into the logs, the hook_node_validate of moduleA is getting called. The node insert must happen in moduleB. So node_validate of moduleB must be called. I think since the Ajax functions were present in moduleA, the node_validate of moduleA is being called.   Please advice how to proceed in this situation.
I have written code like below and all works fine, but while submitting the form I get the error below. I am trying to filter the second dropdown based on the first drop down selection.     An illegal choice has been detected. Please contact the site administrator.   How do I overcome that error?       function dynamic_location_dropdown_form_alter(&amp;$form, $form_state, $form_id) {   if($form_id == 'product_node_form') {    $location_options = array();    if(isset($form['field_destination']['und']['#default_value'][0])) {     $destination = $form['field_destination']['und']['#default_value'][0];   }   else {     $destination = 0;   }    $location_options = dynamic_location_dropdown_locations($destination);    $form['field_destination']['und']['#ajax'] = array(     'event' =&gt; 'change',     'wrapper' =&gt; 'squadron-wrapper',     'callback' =&gt; 'dynamic_location_dropdown_ajax_callback',     'method' =&gt; 'replace',   );   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#prefix'] = '&lt;div id="squadron-wrapper"&gt;';   $form['field_product_location']['und']['#suffix'] = '&lt;/div&gt;';   $form['field_product_location']['und']['#options'] = $location_options;   } }  function dynamic_location_dropdown_ajax_callback($form, $form_state) {   $country_id = $form['field_destination']['und']['#value'];   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#options'] =  dynamic_location_dropdown_locations($country_id);    return $form['field_product_location']; }  function dynamic_location_dropdown_locations($destination_id) {   $nodes = array();   $nodes[''] = '- None -';   if($destination_id != '') {     $select = db_query("       SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created       FROM {node} node       LEFT JOIN {field_data_field_location_country} field_data_field_location_country        ON node.nid = field_data_field_location_country.entity_id        AND (field_data_field_location_country.entity_type = 'node'        AND field_data_field_location_country.deleted = '0')       WHERE (( (node.status = '1')        AND (node.type IN  ('location'))        AND (field_data_field_location_country.field_location_country_nid = $destination_id)))       ORDER BY node_title ASC     ");     $nodes[''] = '- None -';     foreach ($select as $node) {       $nodes[$node-&gt;nid] = $node-&gt;node_title;     }   }    return $nodes; }
How to write an academic paper for the first time? While writing , I realized I don't really have a good list of resources that could be useful to first-time authors, like MSc or PhD students who write their first paper. I often direct my own students to these two papers:   G. M. Whitesides, , Adv. Mater. 2004, 16, 1375–1377 (). P. E. Bourne, , PLOS Computational Biology 2005, 1, 0341.   I also make sure that they read the journal's editorial policy and authors guidelines.  What are other sources of good information for students and first-time academic authors? What training do doctors/Healers receive above their school education?   A fresh Hogwarts graduate does not seem to have all the skills required to be a Healer, so s/he would need to be learning those skills somehow/someplace. So how/where do they get those skills?  Also, there is one instance of a doctor being praised for inventing a healing spell. Is there any research system, like funding, trials etc or any other source of innovation? How to open port via SSH tunnel? There is a system B with the following open servers: I have a web server listening on port 80 and a ssh server listening on 22. However, only port 22 is publicly available. Now, I would like to create some kind of tunnel, so that I can access B:80 from A. However, my client computer A that would like to connect to the system B is not publicly open, either.  So, all I have is a client computer A from where I would like to access the server B and, there, an open port 22. On A, no port is open or can be opened.  What (I think) I would need is to open locally (on A) some port that connects in some way through port 22 of B to port 80 on B.  Is this possibly without using any man-in-the-middle open servers with multiple ports? Monotonicity of the sequences $\left(1+\frac1n\right)^n$, $\left(1-\frac1n\right)^n$ and $\left(1+\frac1n\right)^{n+1}$ Show that $\prod (1- P(A_n))=0$ iff $\sum P(A_n) = \infty$ Search across Stack Exchange sites in Android app Is it possible to search for a question across all Stack Exchange sites in the Android app?   Right now I can search in only one specific site at a time.   If not, can you add that feature? Create 128 Barcodes within Excel Is there a way to create Barcodes (128 standard) on a Mac, preferably via an add-in?  I need it to create barcodes in Excel sheets (or moreso a friend of mine needs it).   I have tried all VBA macros and fonts I found on Google, but none give me a scannable result (usually there are weird characters like ó's mixed in). Does anybody have a working solution? I accidentally posted a question without being logged in. Is there a way to associate that question with my account?   For more information, visit &quot;&quot; in the .   a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms) What does Superman do with his regular clothes after changing in the phone booth? We all know that Superman changes in the phone booth. But where does he put his regular clothes while he's on a mission? He doesn't throw it out, because he changes back. But we don't see him carrying a bag of dirty laundry while he's on a mission.  ("In his right hand, Superman has Lois Lane, and in his left hand he seems to be holding... boxers??)  And I can't imagine he leaves it in the phone booth.  So where does Superman leave his regular clothes after he changes? Using Pigeonhole Principle to prove two numbers in a subset of $[2n]$ divide each other Let $n$ be greater or equal to $1$, and let $S$ be an $(n+1)$-subset of $[2n]$. Prove that there exist two numbers in $S$ such that one divides the other.   Any help is appreciated! Combination proof for $n(n+1)2^{n-2}=\sum_{k=1}^{n}k^2\binom{n}{k}$ How can I show that   let $n$ and $k$ be integers.  $n(n+1)2^{n-2}=\sum_{k=1}^{n}k^2\dbinom{n}{k}$  It seems a bit confusing to me on the left hand side. You have a set of $n$ people on a team and you keep picking $k$ people who will play a match and you pick before that a captain $k^2$. How to set scale across all blender objects and keyframes? Do Cleric's domain spells add slots? I'm a little bit confused with the whole spell system and additions to them. If I pick for instance Tempest Domain Spell, are the spells additional to the other ones? (2 at level 1) So do that make it 3 spells? Does the domain add slots too?  And also, I've read about people choosing multiple domains, is that possible? Group theory proof of existence of a solution to $x^2\equiv -1\pmod p$ iff $p\equiv 1 \pmod 4$ I've read through the elementary proof of why there exists a solution $x$ to $x^2\equiv -1\pmod p$ iff $p\equiv 1 \pmod 4$ for $p$ an odd prime. Is there a group theory generalization for this fact as well? A real $2 \times 2 $ matrix $M$ such that $$M^2 =  \begin{pmatrix} -1&amp;0 \\ 0&amp;-1-\epsilon  \\   \end{pmatrix}$$ (a) exists for all $\epsilon &gt; 0$. (b) does not exist for any $\epsilon &gt; 0$. (c) exists for some $\epsilon &gt; 0$. (d) None of the above is true.  Attempt: I couldn't think of any theory base to prove / disprove the existence of such a matrix. Could someone please give me a hint on how to go about this problem? Thank you very much for your help in this regard. The set of real numbers and power set of the natural numbers I have learnt that the cardinality of the power set of the natural numbers is equal to the cardinality of the real numbers. What is the function that gives the one-to-one correspondence between these two sets?  I have also learnt that there exists no set whose cardinality is strictly between the natural numbers and the real numbers. Is there a proof of this or at least some intuitiveness behind it? Python BeautifulSoup findAll by "class" attribute "It's cold today" -- what term do linguists use to call "it" when it's used as the subject of a sentence, but has no real antecedent? Styling border to match fill in QGIS? In the past I have just manually matched the color of the border to the color of the fill, but this can be time consuming.   I am wondering, is there any way to have the program automatically match the border color to that of the fill?   The fill color is being assigned through the styling tab in layer properties.  Using QGIS 2.8.6 How to upgrade Ubuntu from an ISO image I'm using Ubuntu 10.04 now and want to Upgrade to Ubuntu 11.04. The problem is my net connection is very slow and I can not do a network upgrade from the "Updates Manager".  So, is there a way that I can download the Ubuntu upgrade as an bootable CD image and upgrade from it?