[fixed?][bug] Recs not working in some browsers

Drahken

Cross-eyed Cyclops
In at least 2 firefox based browsers, making recs doesn't work, yet in another it does. (The working one falls in between the other 2 newness-wise, so it's not an issue of being too old or too new.)
When you go to the add recs page for a manga or anime and start typing a name into the field, it's supposed to give suggestions/auto complete. In this bug, it's not doing so. While this seems like just a superficial issue, if you type in the exact full name & submit the rec, it doesn't go through. It just bounces you back to the add recs page with all the fields blanked.
I have made sure all content filters are off, javascript is enabled, etc.

I ran firebug in one of the bugged browsers & in the one that works, and the only thing which seems to apply is this;
Code:
tinymce is not defined
(?)()3 (line 1)
b(t=[Document add, [function()]])jquery.js (line 1)
t = [Document add, [function()]]
b(e=Document add, t=[Document add, [function()]])jquery.js (line 1)
e = Document add
t = [Document add, [function()]]
b(e=undefined)jquery.js (line 1)
e = undefined
b(e=DOMContentLoaded )jquery.js (line 1)
e = DOMContentLoaded
This is from the bugged browser & does not appear in the non-bugged one.

I suspect this may be related to the autocomplete function that was added to the search bar at the top of all pages a while back, as the autocomplete in recs in the working browser currently matches that format (with cover pics & such), which didn't used to be the case back when recs worked properly in the bugged browsers (I haven't tried to make recs in a long time, so I don't know exactly when the bug started).
Oddly though, the new search dropdown works just fine in the bugged browsers, it just doesn't work in the recs box.
 
Re: [bug] Recs not working in some browsers

This probably has nothing to do with the autocomplete at the top of the page.

When the form is initialized, the first thing it does is initialize tinymce. tinymce is loaded in async mode and form is initialized on document ready event. There is no guarantee that code loaded in async mode will be ready on document ready event and this is the bug. Since tinymce is not there the form initialization fails and the form doesn't work as intended.

It's quite interesting that it showed up only now. I wonder if there are major differences in the way different browsers handle async loading of JS or are people from FireFox making some changes now.

It should be possible to fix this by replacing:
Code:
$(document).ready(function(){
with:
Code:
$(window).load(function(){
in the form init code.

I just tested this using userscripts and it seems to work, but this isn't the best solution. It would be better to just load tinymce synchronously, but I wouldn't bu surprised if the code for loading tinymce was shared between several pages and async might be just fine on most of them.
 
Last edited:
Re: [bug] Recs not working in some browsers

Something has changed on a-p. I used to be able to do recs just fine with the exact browser that doesn't currently work.
The last rec I made was in nov 2015, which was before the autocomplete thing was added at the top of the page. At that point the autocomplete for recs did not have the cover images next to each entry (like the top of page autocomplete does), it just had plain text. Now recs don't work in the same browsers where they used to work fine & in the ones where they do work they have the same "upgraded" dropdown as at the top of the page, complete with cover pics.
The fact that the dropdown function for recs was changed, and especially the timing of the change, pretty much guarantees that said change triggered the current problem. It might not be the change itself that's the problem, it might be that they changed some other setting at the same time, or accidentally added a stray comma or w/e, but it's very unlikely to be pure coincidence. (Maybe the code in the page used to use "load" before the change & for whatever reason they changed it to "ready" when they made the change.)
 
Re: [bug] Recs not working in some browsers

Maybe loading tinymce was switched to loading in async mode only recently and it just worked in Chrome, so the person who did it didn't notice.

Loading scripts asynchronously makes the page appear ready faster, so it would make sense if someone decided to add this as an optimization (additionally doing this can have an effect on your position in google index, although this alone would change very little).
 
Re: [bug] Recs not working in some browsers

I'm pretty sure JAhU is correct, I updated tinymce to be asynch fairly recently (for exactly the reasons mentioned, to speed up the page). It's a pretty big file so I'm going to try to load the form init on window.load instead of reverting the asynch. This should go out in the next week or so, so Drahken please let me know if that fixes things for you. And sorry!
 
Re: [bug] Recs not working in some browsers

It doesn't look like that would fix it anyway. I just used a userscript to change ready(function to load(function as jahu said, but the problem still persists.

I also tried changing <script src="/inc/js/tiny_mce/tiny_mce.js" async> to "sync" and simply removing "async" altogether, neither worked.
 
Last edited:
Re: [bug] Recs not working in some browsers

This should be fixed now
 
Back
Top