While porting to Backdrop and testing, I found that the Pinterest button doesn't work. It also seems to make sense to default the URLs to https.

Comments

laryn created an issue. See original summary.

laryn’s picture

StatusFileSize
new2.33 KB

Here's a patch that works for me (the hack on the Pinterest URL doesn't seem to be required anymore).

adamps’s picture

@laryn Thanks for the report

The hack on the Pinterest URL came about from an issue raised by a past user who gave a clear description of why it was needed, including the link present in the code file.

I don't use Pinterest myself. It's difficult as a maintainer when someone proposes a patch stating that "the button doesn't work" without giving details. If I were to apply your patch it seems possible that it would starting working for you but stop working for the other user. Please can you provide any more details

  • Why it doesn't work now/for you when presumably it did work before?
  • Why the hack isn't needed now even though presumably it was needed before?

Also note that D7 is now bug fixes only, with D8 as the active branch. The change to use HTTPS sounds like a good idea, but should go into D8 please as a separate patch.

laryn’s picture

@AdamPS I can't speak to why the hack was added in that way. I only started digging because I set it up for someone and Pinterest was not working. I looked at the link that was in the code but didn't see a clear reason why this hack was needed. The thread on SE seems to be about preventing Pinterest's js from hijacking things, but you aren't loading Pinterest's js to my knowledge (ie. "No third-party scripts").

I found the old issue (https://www.drupal.org/node/2566647) and see it seems to relate to a separate module hijacking the link. I don't have a solution for that (I don't use that other module) but do still report that Pinterest links were not working for me.

I've made a separate D8 patch for SSL.

adamps’s picture

Correct, RRSSB does not load 3rd-party scripts, but I believe the scenario is that something else on the page might have loaded them. It seems desirable if RRSSB still works in this case.

I acknowledge your report "Pinterest links were not working for me" but I don't think you have yet given any details for this: what steps to reproduce, what do you actually see, how does this differ from what you expect to see.

Thanks for raising the separate issue.

laryn’s picture

Here's an example of what I mean when I say it doesn't work. This link:

...produces the "Whoops! We couldn't find that page." response.

This page:

...produces a functional response.

(Screenshots attached).

adamps’s picture

Title: Tweaks in the .config » Pinterest button doesn't work
adamps’s picture

I don't use Pinterest and am having trouble reproducing.

Have you tried clicking the links in your comment? If I hover over them in Firefox it shows the exact same URL destination. I wonder if Pinterest will actually receive the exact same protocol bytes in each case - i.e. the encoding is a local concept on this page on drupal.org.

Perhaps you could share your site page, or send me a private message with the URL?

adamps’s picture

Status: Active » Postponed (maintainer needs more info)

OK now that I have made a pinterest button I thought I might as well test for myself. It works fine for me in Firefox with %2F. So the first step is to establish why it doesn't work for you. Might it be a browser-specific thing?

The proper solution looks like it might be to use http://pinterest.com/pin/create/link/?url=

Any fix here needs to be tested with the Pinterest JS loaded.

laryn’s picture

Strange! I am in Firefox as well when I get the "Whoops!" page. I'll do some testing with the solution you suggest (I agree) with the Pinterest JS also loaded on the page.

This occurs even when I click on the links in my earlier comment.

laryn’s picture

StatusFileSize
new824 bytes

Results of testing on a fresh install (dev server), on a page with Pinterest JS added:

  • Current version (with %2F): Pinterest JS button works; RRSSB Pinterest button produces "Whoops!" error page
  • Patched version (removing %2F and replacing with a slash): Pinterest JS button works; RRSSB Pinterest button disappears
  • New solution suggested in #9: Pinterest JS button works; RRSSB Pinterest button works

Patch attached.

  • AdamPS committed 5c5a4b6 on 7.x-2.x
    Issue #2909768 by laryn: Pinterest button doesn't work
    
adamps’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks @laryn

  • AdamPS committed 4528395 on 8.x-2.x
    Issue #2909768 by laryn, AdamPS: Pinterest button doesn't work
    
adamps’s picture

Assigned: laryn » Unassigned

Status: Fixed » Closed (fixed)

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