Pinterest recently introduced Board Sections: https://blog.pinterest.com/en/new-way-organize-your-ideas-pinterest

This allows users to organize larger boards into sections, which can be viewed on their own.

Board Section urls are of the form https://www.pinterest.com/user/board/section-name/ . These are valid URLs for populating a widget, as can be tested here: https://developers.pinterest.com/tools/widget-builder/?type=board&boardH...

The regex currently in place for validating Boards rejects these URLs, and should be updated to accommodate them.

Additionally, URLs with UTF-8 characters are valid Pinterest URLs, i.e.

https://www.pinterest.com/pinterestfr/pinterest-100-2018/enfants-éducation/

These should also be accommodated by the validations patterns.

Further, when copying such URLs from the location bar, browsers often URL encode them automatically, giving for the above:

https://www.pinterest.com/pinterestfr/pinterest-100-2018/enfants-%C3%A9d...

Since we can't know that a URL would be of one form or the other, we should allow `%` as a character in places where there might be UTF-8 characters.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timcosgrove created an issue. See original summary.

timcosgrove’s picture

Title: Media Entity Pinterest should support Board Sections » Media Entity Pinterest should support Board Sections and UTF-8
Issue summary: View changes
timcosgrove’s picture

Issue summary: View changes
timcosgrove’s picture

This adds a completely optional <section> named group to the boards regex. The group is identical to the board regex, except for it being optional.

It also adds the u flag to the regexes that support UTF-8, and adds the % character to those locations that might show that, given a urlencoded UTF-8 character.

timcosgrove’s picture

Status: Active » Needs review
timcosgrove’s picture

Updated patch which removes the % in the regex and instead urldecodes items that are being tested. This is in line with what is done in the Pinterest widget JS.

  • bonus committed ae79af3 on 8.x-2.x authored by timcosgrove
    Issue #2939923 by timcosgrove: Media Entity Pinterest should support...
gg4’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
Status: Needs review » Needs work

Needs backport to 8.x-1.x

  • bonus committed a1fdfb3 on 8.x-2.x
    Revert "Issue #2939923 by timcosgrove: Media Entity Pinterest should...
gg4’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev

Patch in #6 breaks regular Board embedding.

timcosgrove’s picture

I went with an approach of treating board sections separately, which we probably wanted to do anyway. The regex more explicitly excludes section URLs from boards and vice versa, provides a template for it, adds it to MetadataAttributes, etc.

gg4’s picture

  • bonus committed 5ebdfd8 on 8.x-2.x
    Issue #2939923 by timcosgrove, bonus: Media Entity Pinterest should...
gg4’s picture

Status: Needs review » Needs work
FileSize
1.45 KB

Commited #12 and fixed a few things in the process.

Setting back to needs work for 8.x-1.x.

gg4’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
gg4’s picture

Status: Needs work » Needs review
FileSize
7.58 KB

  • bonus committed 91ffed4 on 8.x-1.x
    Issue #2939923 by timcosgrove, bonus: Media Entity Pinterest should...
gg4’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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