-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong values in subfields when value is switched too quickly #61
Comments
Thanks a lot for reporting. It is indeed specific but still noteworthy, i.e. worthy for reporting. Current environment on sandbox:
|
One way to fix this is to use synchronous queries (so they always complete in the right order): diff --git a/res/scriptSelect.js b/res/scriptSelect.js
index 00b81ad..9271991 100644
--- a/res/scriptSelect.js
+++ b/res/scriptSelect.js
@@ -253,7 +253,7 @@ function SFSelect_arrayEqual(a, b)
param['approach'] = 'function';
}
- var posting = jQuery.get( mw.config.get('wgScriptPath') + "/api.php", param );
+ var posting = jQuery.ajax( mw.config.get('wgScriptPath') + "/api.php", { data: param, async: false } );
posting.done(function( data ) {
// Let's pass values
But of course this can cause bad performances. |
This issue appears to still be present in the 3.0.0 release. @toniher A patch was proposed. Perhaps you may have a look into this for the next release. |
@Rudloff @kghbln I wonder how to do this without forcing a synchronous connection... I would try adding a data attribute with a timestamp value to the target HTML element so it should match with the same property value from the resulting data object retrieved from the post query in order to allow its modification. |
Soemone reported a very specific issue on one of my wikis.
You can test that here: https://archi-mediawiki.netlib.re/Sp%C3%A9cial:RunQuery/Recherche_avanc%C3%A9e?uselang=fr
str
on your keyboard.What happens then is that Strasbourg is selected but the Sous-quartier and Rue fields are populated with values from Stosswihr (the value before Strasbourg in the Ville list).
This is probably some kind of race condition because the queries are asynchronous.
I had a hard time reproducing on sandbox because you don't have so many values there, but I think I found a similar issue here: https://sandbox.semantic-mediawiki.org/wiki/Sp%C3%A9cial:RunQuery/Test_keyboard
The second field should be empty but it is populated with values from Europe. (Probably because the query for Europe ends after the query for null.)
The text was updated successfully, but these errors were encountered: