Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

Enable/Disable script button not working/intermittent

1435105355
Lucian
Pro
API Scripter
Hi, I'm very new to using the API and have been playing around for a few hours now with various scripts. One thing that seems really strange is that the Disable button below the scripts doesn't seem to do anything. The page reloads, but it remains as "Disable Script" rather than toggling. At least, that's what I thought was happening, until I came back to it after half an hour of fiddling and reading on the forum and found that some of my scripts were now disabled, but I could re-enable them again! Is there a known issue with this? Am I doing something wrong? Thanks, Lucian
This reproduces 100% for me: I haven't been able to disable a script for months without deleting it.
Yo Lucian! To answer your question, no you 're not doing anything wrong. From what I can tell if you disable or enable a script simply reloading the page again should accurately show the script you chose to disable. I'm not sure that you could call this an "issue" since the enable/disable works fine itself but roll20 mods do look around the forums and i'm sure one will be happy to assist you further! Happy Party Slaying, Joe
1435116696
The Aaron
Roll20 Production Team
API Scripter
As Joe mentioned, this is a display issues. If you disable a script, the tab doesn't update to the displayed look until the next time the page is refreshed. if you are disabling several scripts in a row, you will notice the tab color lags one behind each time you click the disable button. It's mostly an annoyance, but I do wish it would get fixed at some point.
1435137124
Lucian
Pro
API Scripter
Hi, Thanks for the responses. I think that there may be different things going on for different people here. In my case it's definitely *not* a display issue. When I push the "Disable script" button, the whole page reloads anyway, and even if I then Shift-Refresh the page again to be sure, the script is still not disabled. Interestingly, I just debugged it in Firebug, and it worked, but it looks like there's a horrid race condition there. After it posts the request to disable the button, it adds "" to the href of the page to force a reload (not sure why). But it does this immediately following the $.post call, not inside the callback. Most times that means that the page is reloaded before the AJAX callback ever gets run, and I'm wondering whether it sometimes manages to reload the page before the POST even happens. Either way it would seem that moving the line window.location.href = window.location.href + ""; Inside the callback from the POST to update the status of the script (or removing it entirely if possible) would fix the issue. This could be a 2 second fix, so hopefully a dev might see this and take a quick look. Cheers, Lucian
Thanks for creating a bug report thread Lucian, since we are helping in the other forum I am closing this thread.