My site keeps generating requests to pages like /node/96/httpshttp

The /httpshttp suffix causes problems on certain pages that want to interpret the 'httpshttp'.

Whe I look at the source for may pages, the only reference to "httpshttp" is the following excerpt from the jQuery.extend(Drupal.settings line ...

"addthis":{"widget_url":"httpshttp#pubid=MY_ID?async=1"}

where "MY_ID" replaces my actual AddThis Id. Any thoughts?

Ken

Comments

matglas86’s picture

Title: "addthis":{"widget_url":"httpshttp#pubid=MY_ID?async=1"} » Wrong widget url for https page
Status: Active » Needs review
StatusFileSize
new411 bytes

Patch f0c4a introduced a bug I tried to fix in #1403210: Https secure page fails with AddThis script.

Please see if this patch fixes it.

kenwest’s picture

@matglas86,

Your patch seems to do the trick.

It appears you're assuming the URL starts with "http"? What if the administrator puts a copy of the addThis Widget JS in a local file for caching purposes? eg "js/addthis/cache/widget.js". Will this function do the right thing and leave the URL unchanged?

Perhaps you should check the URL starts with "http://" and replace that?

Thanks,

Ken

matglas86’s picture

StatusFileSize
new455 bytes

You are absolutely right. Here is a better check.

kenwest’s picture

@matglas86,

I've applied your patch, and it continues to work for me. However, I'm not keeping the widget js on-site, so I'm not testing it for the case you're trying to cover.

Thanks!

Ken

matglas86’s picture

Status: Needs review » Reviewed & tested by the community

Ok thanks. Ill commit it and if problema arise we'll notice. :)

matglas86’s picture

Category: support » bug
Status: Reviewed & tested by the community » Fixed

Committed at 066ca7e

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

TelFiRE’s picture

So are we forced to use dev if this issue arises? It doesn't appear to have been committed to non-dev as it's been over half a year since the 'other' release was updated but you're recommending not to use the dev on the project page. Not sure what the best practice would be.

Thanks for your efforts

sstedman’s picture

I can confirm that the patch in #3 works.

After spending quite a bit of time trying to figure out why I could not complete an order in Ubercart, I finally tracked down the exact url listed by the OP with Firebug: "addthis":{"widget_url":"httpshttp#pubid=MY_ID?async=1"}, which led me to this page.

I don't really get why this js is being loaded into the cart/checkout/review page for Ubercart. I would think that addthis.js would only be loaded on pages where the Addthis widget actually appears. In any case, thanks for the fix.