XF 1.5 Quick Reply Doesn't Work in Chrome

Saburov

Active member
#1
Hello. my forum's quick reply function doesn't work properly in chrome and opera browsers. In firefox there is no problem. I cleaned my browsers cache, I tried different computers, disabled addons, even I have try on my friends but the problem continues.

forum.muhasebecafe.com

When I send something with quickreply, the sending symbol at the top right loading forever. Yes the message was sent but page doesn't refreh itself. I have to refresh the page for see my message. What causes this problem?

2016-10-07_15-36-49.png
 

Saburov

Active member
#3
I found the reason of the problem. Because of the google adsense code in the ad_message_body template. When I remove the code, problem solved. I think this is a kind of bug.
 

Chris D

XenForo developer
Staff member
#4
Thanks Chris. But I don't understand exactly. Is there a solution for this? Do you think there is a problem with adsense JS content?


Code:
<xen:hook name="ad_message_body" />
<center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- esnek reklam -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-XXXXXXXXXXXXXX"
     data-ad-slot="8689386314"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></center>
<br />
Essentially it's a bit of a race condition between the auto detection of the width of the ad slot (presumably these are the "responsive" ads) and the post being inserted into the page by us. For example if their code detects a width of 0 (which is basically correct if the content is currently hidden) then the adsense code falls over and blocks the rest of our code running.

I'm somewhat sure we implemented something which might help, but I'm currently struggling to locate it...
 

Chris D

XenForo developer
Staff member
#5
Somewhat staring me in the face...

Rich (BB code):
<xen:if is="!{$isShowingNewPosts}">
<center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- esnek reklam -->
<ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-XXXXXXXXXXXXXX"
    data-ad-slot="8689386314"
    data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></center>
<br />
</xen:if>
Note the xen:if conditional now surrounding your existing code; this will prevent the advert code from being loaded when a new post is created, and therefore prevent the problem.
 

ge66

Active member
#7
I had a similar problem when testing a new adsense ad placement in XF1.5, I will try if this fix the problem, had a lot of not so happy user before I found that the adsense was the problem.

@Chris D is this somehow fixed in XF2.0 or will I have to put similar extra code to make it work?
 

Mike

XenForo developer
Staff member
#8
I believe I tried to reproduce the issue in 2.0 and couldn't, but it's not strictly possible to say with arbitrary HTML/JS, so we'd recommend you test customizations to confirm.
 

ge66

Active member
#9
With the fix on XF1.5 users haven't seen any problems. So it seems to solve the problem.
I only saw the problem once, and that I think was when I posted post number 21 in a thread. I also think the problems apeared on busy threads, probably when other users posted before a user had his post posted.

Would this code work for XF2 is there a $isShowingNewPosts <xf:if is="!$isShowingNewPosts">?
 
Top