Support » Plugin: MimeTypes Link Icons » Possible bug in MimeTypes Link plugin for multiple calls in one page

  • Resolved ripperdoc

    (@ripperdoc)


    Hi! Great plugin but I noticed strange behaviour when calling a list of excerpts. The excerpt will show the style-code coming from mime-type, even if there is no attachment to the post.

    The problem is that you use a global variable $add_attachment_style that is not reset between calls. So it stays true, adding style code to all calls to the_content() thereafter on the same page. The fix seem to be to simply reset $add_attachment_style in beginning of function mimetype_to_icon().

Viewing 11 replies - 1 through 11 (of 11 total)
  • yagraph

    (@yagraph)

    Hi,

    I noted the same problem on my current project…

    As ripperdoc suggested, I added
    $add_attachment_style = false;
    on line 252 of mime_type_link_images.php

    but it do not solve the issue…

    Have you any code to share ripperdoc ?

    Thanks for your plugin anyway !

    yagraph

    (@yagraph)

    A link illustrating the bug :
    http://www.grandeurnature.eu/gn/creation/residences/

    Right column is generated with Recent Post Plus.

    Thanks again !

    Plugin Author eagerterrier

    (@eagerterrier)

    @ripperdoc & @yagraph – thanks for the tips and sorry for not getting back sooner – I’ve been on hols.

    Funnily enough, I am releasing a new version of the plugin tomorrow that fixes this bug, allows the site owner to choose to have an enclosing div that turns the plugin off (e.g. class of wp-caption does not display the icons)

    Glad you like the plugin.

    I’ll try to release the plugin around 16:00GMT, but will let you know on this channel when I have done so…

    yagraph

    (@yagraph)

    Hi eagerterrier,

    Good news, and thanks !

    If you need any testing, please feel free to ask 😉

    Plugin Author eagerterrier

    (@eagerterrier)

    ok – this is committed to live server

    Changes should show up soon. let me know how you get on…

    TC

    yagraph

    (@yagraph)

    Hi eagerterrier,

    I’ve just updated your plugin, thanks…
    But I’m sorry to say it do not solve the issue I encounter…
    I tried to your new “Enable disabling class name” option, but with no results… I also tried your “Enable Asynchronous Replacement” with no success.
    Maybe it’s not linked with this bug ?

    Please take a look here : http://www.grandeurnature.eu/gn/actions/prestations/

    See the .mtli_attachment { display:inline-block; height:24px; background-position: top left; background-attachment: scroll;
    displayed at the end of the first post when I use “the_excerpt” function to retrieve post in this category ?
    If I produce the same page with “the_content”, I get those lines at the end of every post which is triggered by MimeTypes Link.

    If your understand ripperdoc suggestion, I suppose it’s the way to dig into…

    If you need my template code, I can share it.

    Cheers

    Plugin Author eagerterrier

    (@eagerterrier)

    @yagraph – OK – I understand your problem now. WP is doing my code then trimming it down for the excerpt. When it performs the strip_tags function, this just gets rid of the <style> tags, but not the stuff in between…

    I think I can switch the whole plugin around, so I enqueue the CSS as a static file in the header, then call the rest later, which would mean it wouldn’t show up in the excerpt

    I can’t do it today, but will try at the weekend if possible, or Tuesday latest (public holiday in UK on Monday). I will mark this post back as unresolved to give me a reminder…

    yagraph

    (@yagraph)

    Thanks a lot eagerterrier !

    I’m not in a hurry (Tuesday is perfectly fine), but I really hope to remove thoses lines before publishing the website officially 😉

    We keep in touch, have a nice weekend.

    Plugin Author eagerterrier

    (@eagerterrier)

    OK – just committed version 2.0.4. This should be available in an hour or so.

    I have moved all CSS into the header, so you shouldn’t be bothered by this problem again.

    I won’t mark this thread as resolved until I hear back from you.

    yagraph

    (@yagraph)

    Hi eagerterrier,

    Your update quickly porpagated, and I’m glad to tell you that it completely solved my issue !
    Thanks a lot for your work, I’m nearer to publishing date now 😉

    Plugin Author eagerterrier

    (@eagerterrier)

    really glad to hear it.

    I’ll mark off as resolved. Good luck with the rest of your project…

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Possible bug in MimeTypes Link plugin for multiple calls in one page’ is closed to new replies.