bgarrels / textpattern

Automatically exported from code.google.com/p/textpattern
0 stars 0 forks source link

Async doesn't take JavaScript initialization delay into account #227

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently Textpattern's asynchronous forms and links do not take into account 
JavaScript initialization delay or other block causes.

Please see this topic posted by gilest:
http://forum.textpattern.com/viewtopic.php?id=38330

A async link or form can be interacted before JavaScript is ready. When this 
happens and user interacts with such element before the async code is attached 
properly, well, things break.

On the Write panel this means that the user is taken to the script response 
page.

To simulate the problem:

1. Unlink async callback hook from Write panel's form.
2. Click submit.
3. You are taken to the response script.

That's what users are pound to see from time to time in real world use. 
Remedying this issue can be bit hard. I may suggest:

1. Hiding all async forms (or all forms) until JavaScript is initialized.
2. Making forms loop back until JavaScript is initialized.
3. Hiding submit button until initialized (note that this doesn't prevent 
sending).
4. Making sure that there is always non-async code path available.

I personally would favor 1 and 3 over options 2/4. Both 2/4 are nasty and 
require a lot of code from PHP. For instance it means that each plugin and core 
panel needs to provide two code paths.

Original issue reported on code.google.com by jukka.svahn@rahinaa.biz on 19 Jul 2012 at 10:34

GoogleCodeExporter commented 9 years ago

Original comment by r.wetzlmayr on 19 Jul 2012 at 2:15

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r3980.

Original comment by r.wetzlmayr on 19 Jul 2012 at 2:47