Not a Bug Editing first post of a page makes it disappear

Discussion in 'Closed Reports' started by abdfahim, Feb 9, 2017.

  1. abdfahim

    abdfahim Well-Known Member

    I don't know why I feel I have seen this somewhere, but couldn't find it in this section. Hence I am reporting it.

    This issue does not happen in default style, it happens only with EDGE.

    When I have a Google Ad Unit in the "ad_message_after" template, editing the first post of a page (any page of a thread) makes it (the first post) disappear. A loading sign appears continuously at the top-right corner, as if it is trying to load something but fails to do so. Also it results the following error in the console.


    Copy Source
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0">
    <li class="message">
        <script async src="//"></script>
        <ins class="adsbygoogle"
        (adsbygoogle = window.adsbygoogle || []).push({});
  2. Russ

    Russ Designer

    If you place that code in the default style after the last line </li> does it reproduce the error then as well?
  3. abdfahim

    abdfahim Well-Known Member

    Sorry, I didn't get it properly. Can you please elaborate what should I test?

    The default style does not produce the error at its current state. I also have the similar code at ad_thread_view_below_messages (so the Ad appears between the last post and quick reply block) without any issue.
  4. Russ

    Russ Designer

    Essentially can you take that exact code you posted, and try it on the default style. Paste it inside the message template after the very last line. See if that replicates it.
  5. abdfahim

    abdfahim Well-Known Member

    Oh sorry, silly me. The same error also happens in default style after pasting the same code in message template (I don't know what I was thinking before to check in default style without pasting the code!!!).

    Just for your information, below is what happens when I edit first post.

    Before Edit:
    • First <LI> is the message,
    • 2nd <LI> is the one that contains Google Adsense.

    After Edit:
    • 1st <LI> is hidden message - display:hidden
    • 2nd <LI>: don't know what, empty - display:hidden
    • 3rd <LI>: Google Adsense.
  6. abdfahim

    abdfahim Well-Known Member

    Some more relevant update:

    If I put a normal DIV inside ad_message_after
    Copy Source
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0">
    <li class="message">Test</li>
    , then editing first post duplicates the Test block above (but don't hide the first page).
  7. Russ

    Russ Designer

    Alright... so to be honest I'm not exactly sure why it would be doing it. If you use just basic text it doesn't reproduce it, when I'm back Monday I can post on the official XF forums for some help. Essentially the question would be how to add the message after that <li> in message template without it duplicating.

    Technically it's a visual glitch, it goes away upon refresh but still annoying.
    abdfahim likes this.
  8. abdfahim

    abdfahim Well-Known Member

    Yup right, it is a visual glitch. But it can make user confused. I am not concern about editing first post (as I have editing disabled for members) but same thing happens (from my memory, I've to recheck again though) when a new post makes a new page.
  9. abdfahim

    abdfahim Well-Known Member


    Is there any solution for this case?

  10. Russ

    Russ Designer

  11. Russ

    Russ Designer

    Can you try this conditional:

    Copy Source
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0 AND {$firstPost}">
    See if that works for you.
  12. abdfahim

    abdfahim Well-Known Member

    Perfect ! Though I have no idea what that means :p.

Let's work together on your next project

Contact us today to talk about how we can help you

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.