WordPress.org

Ready to get started?Download WordPress

Forums

Auto ThickBox Plus
[resolved] Issue between Auto Thickbox Plus and Connections (12 posts)

  1. owcv
    Member
    Posted 2 years ago #

    There is a problem with the cMap-Template of Connections and activated Thickbox-plugin. Links like "Show Map", "Show Bio", "Show Notes" and so on does not work anymore, unless I deactivate Auto Thickbox Plus. Is there a solution for this (obviously javascript) issue?

    http://wordpress.org/extend/plugins/auto-thickbox-plus/

  2. shazahm1
    Member
    Posted 2 years ago #

    @owcv

    The reason is because that plugin re-writes the links but does so incorrectly. I could work around that but I think a better solution would be for the dev to better target the re-writing of the links.

  3. owcv
    Member
    Posted 2 years ago #

    The plugin has the possibility to deactivate the re-writing of the links on text links. Unfortunately that does not work. So I suppose an update is needed.

  4. attosoft
    Member
    Plugin Author

    Posted 2 years ago #

    Hi owcv,

    Thanks for using Auto Thickbox Plus, and sorry for late reply.

    I don't have cMap-Template of Connections (it's not free), so I can't debug the plugin in reproduce environment.

    But I guess this problem caused by iframe function in auto-thickbox.php. Please try to modify auto-thickbox.php at line 55.

    old: return auto_thickbox::iframe($anchor);
    new: return $anchor;

    * iframe function is defined by Auto Thickbox plugin (not Plus). I think this function is buggy.

    The plugin has the possibility to deactivate the re-writing of the links on text links. Unfortunately that does not work.

    "ThickBox on Text Links" option targets links to image (i.e. link URL ends with image extensions).
    But links like "Show Map", "Show Bio", "Show Notes" and so on are not linked to image (link URL may be only "#").
    This is the reason why this option does not work.

  5. attosoft
    Member
    Plugin Author

    Posted 2 years ago #

    To Steven Zahm

    The reason is because that plugin re-writes the links but does so incorrectly.

    Please give me the correct URL and incorrect URL rewritten by Auto Thickbox so that I can fix the problem.

    Thanks.

  6. attosoft
    Member
    Plugin Author

    Posted 2 years ago #

    But I guess this problem caused by iframe function in auto-thickbox.php.

    My comment may be wrong. Auto Thickbox plugin rewrite links only in the following condition.

    • a@href value ends with image extensions (png, jpg, jpeg, gif, ...)
    • a@class value contains "thickbox"

    But "Show Map", "Show Bio" and "Show Notes" links are not matched with above condition.

    • <a class="cn-map-anchor toggle-map" id="map-anchor-64f2df9c9a4f76" href="#" ...>Show Map</a>
    • <a class="cn-note-anchor toggle-div" id="note-anchor-64f2df9c9a4f76" href="#" ...>Show Notes</a>
    • <a class="cn-bio-anchor toggle-div" id="bio-anchor-64f2df9c9a4f76" href="#" ...>Show Bio</a>

    After all, I don't know what causes this problem. Since I can't debug any more without c-Map template.

  7. shazahm1
    Member
    Posted 2 years ago #

    @attosoft

    Thanks for looking into this. When Auto Thickbox is activated the links are rewritten like so:

    <a class="cn-note-anchor toggle-div" id="note-anchor-32384f2f3786995e9" href="#" 0="data-uuid='32384f2f3786995e9'" 1="data-div-id='note-block-32384f2f3786995e9'" 2="data-str-show='Show" 3="Notes'" 4="data-str-hide='Close" 5="Notes'">Show Notes</a>
    
    <a class="cn-bio-anchor toggle-div" id="bio-anchor-33054f2f37869bcaf" href="#" 0="data-uuid='33054f2f37869bcaf'" 1="data-div-id='bio-block-33054f2f37869bcaf'" 2="data-str-show='Show" 3="Bio'" 4="data-str-hide='Close" 5="Bio'">Show Bio</a>
    
    <a class="cn-map-anchor toggle-map" id="map-anchor-32384f2f3786995e9" href="#" 0="data-uuid=" 32384f2f3786995e9""="" 1="data-str-show=" show"="" 2="Map" "="" 3="data-str-hide=" close"="" 4="Map">Show Map</a>

    I noticed that I'm using single quotes for a couple of the data attributes instead of double quotes. I wonder if that is throwing off the re-writing. I'll have to make them double quotes to see if that resolves the issue.

  8. shazahm1
    Member
    Posted 2 years ago #

    @attosoft

    I made sure all quotes are now double quotes and the links still are rewritten incorrectly.

  9. attosoft
    Member
    Plugin Author

    Posted 2 years ago #

    To Steven Zahm

    Thanks a lot for more helpful information.

    I was able to reproduce the bug by writing the links directly such as "Show Notes", "Show Bio" and "Show Map". And I found that shortcode_parse_atts() function called from anchor-utils.php is the cause.

    shortcode_parse_atts() in wp-includes/shortcodes.php does not accept custom data attributes (data-*). shortcode_parse_atts() splits data-* attribute name with '-', then links would corrupt. This is a bug in Auto Thickbox Plugin (original), and for that matter, a bug in WordPress Shortcode API.

    I'm not the original author, so I don't understand yet how anchor-utils.php works. But I added the workaround for this issue. I would appreciate it if you check latest revision of Auto Thickbox Plus plugin.

    Thanks for your help to solve the issue.

  10. shazahm1
    Member
    Posted 2 years ago #

    @attosoft

    Sorry for the delay, the .7 version seems to work just fine now. Thanks for looking into this! I've upped your rating.

  11. owcv
    Member
    Posted 2 years ago #

    Thanks to you both for looking into this issue and finally solving it! Great work! :-)

  12. attosoft
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Steven and owcv,

    I'm glad to hear that the issue was resolved.
    I changed this topic status to "resolved".

    I've upped your rating.

    Wow, Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic