I was getting a Javascript error in share_widget_link.js because the jQuery selector $("li.share_" + share.shareID + "_" + share.nid) does not return any results. So the attached patch not only prevents the error, but it corrects the selector so that results are returned.

CommentFileSizeAuthor
share_widget_link.patch662 bytesgribnif

Comments

greenskin’s picture

the 'li' is needed to differentiate link share widgets from node and block share widgets. Though I do like the use of the continue, I'll implement that.

gribnif’s picture

I think that may be part of the reason why the original code did not work for me. In my links, I don't have any "li" tags, just "a". There is an outer <div class="links">, so perhaps you could change the selector to $(".links>a.link-share_" + share.shareID + "_" + share.nid) and have it work in all cases.

gribnif’s picture

I take back what I said. I now see how default themes like Garland are different from mine. This version seems to work for both: $(".links a#share-" + share.shareID + "-" + share.nid)

gribnif’s picture

Status: Active » Closed (works as designed)

I updated my custom theme_links function to more closely match the one in Drupal 6, and now this change isn't needed. I had been using one that was based on Drupal 5's code, which did not use UL and LI tags.