Score:0

Node save button can be clicked while there is still running javascript which leads to unexpected behavior

tk flag

We have Group module installed and a custom field. To be more specific, we can set a value of this field from a dropdown list depending on the selected group.

The behavior is as follows:

  1. Open content creation or editing screen
  2. Select group
  3. Wait until the list of custom values in the dropdown list is updated and select the necessary one
  4. Save

However, there is a problem in such case:

  1. Open content creation or editing screen
  2. Select group
  3. Do not wait until javascript changes selectable options in the dropdown list
  4. Click save as soon as possible while javascript is still running

As a result, we get unexpected behavior when neither group nor value in the custom field is set.

We believe, that this is a problem with custom or core module javascript or AJAX.

Could you please advise if there is any workaround for this situation except waiting until all scripts are executed? Can it be fixed without touching javascript?

unusedspoon avatar
aq flag
You could/should add your own form validate hook function to check the values are as you'd like them. If they aren't then show a form error
id flag
If it is custom code only you can determine that. If it is core or contributed code then this should be a bug report.
Eiki Hanai avatar
tk flag
@unusedspoon We are considering this approach but we are not sure that such behavior can be caught by php
Eiki Hanai avatar
tk flag
@cilefen It is a core or contributed module code. We are searching for solutions but it seems that there are no appropriate ones for our case
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.