Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#40673 closed defect (bug) (fixed)

WP Oembed in Multisite fails when embedded post comes from a different site of a network.

Reported by: imath Owned by: swissspidy
Priority: normal Milestone: 4.9
Component: Embeds Version: 4.5.3
Severity: normal Keywords: needs-patch
Cc: Focuses: multisite

Description

Steps to reproduce:

1/ Create a post in main site.
2/ Create a new site
3/ Go the dashboard of this site
4/ Create a new post and paste in it the permalink of the post created at step 1.

This happens when the post we're trying to embed comes from a different site. I've added some unit tests to illustrate the issue. Without the patch, these two unit tests are failing:

  • test_wp_filter_pre_oembed_result_multisite_sub_othersub
  • test_wp_filter_pre_oembed_result_multisite_sub_main

Attachments (3)

40673.patch​ (4.9 KB ) - added by imath 9 years ago.
40673.diff​ (4.9 KB ) - added by swissspidy 9 years ago.
40673.2.patch​ (906 bytes ) - added by bor0 9 years ago.

Download all attachments as: .zip

Change History (15)

@imath
9 years ago

#1 @imath
9 years ago

  • Keywords has-patch has-unit-tests added

#2 @ocean90
9 years ago

  • Version trunk → 4.5.3

@swissspidy How does 40673.patch​ look to you?

#3 @swissspidy
9 years ago

  • Milestone Awaiting Review → 4.9
  • Owner set to swissspidy
  • Status new → reviewing

This ticket was mentioned in ​Slack in #core-multisite by flixos90. ​View the logs.


9 years ago

This ticket was mentioned in ​Slack in #core-multisite by jeremyfelt. ​View the logs.


9 years ago

@swissspidy
9 years ago

#6 @swissspidy
9 years ago

  • Keywords commit added

Just did two minor tweaks in 40673.diff​. I think this is good to go.

#7 @swissspidy
9 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 41600:

Embeds: Improve performance when embedding a post on Multisite.

After [37798], this fixes embeds coming from a different site in the network.

Props imath.
Fixes #40673. See #36767.

#8 @ocean90
9 years ago

  • Keywords needs-patch added; has-patch has-unit-tests commit removed
  • Resolution fixed
  • Status closed → reopened

The use of ms_is_switched() doesn't seem to be right, see #38253 for a previous case.

@bor0
9 years ago

#9 @bor0
9 years ago

  • Keywords has-patch added; needs-patch removed

#10 @swissspidy
9 years ago

  • Resolution → fixed
  • Status reopened → closed

In 41606:

Embeds: Maintain switched state when embedding a post on Multisite.

Props bor0.
Fixes #40673.

#11 @ocean90
9 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed
  • Status closed → reopened

The current blog isn't restored if $post_id is false.

#12 @ocean90
9 years ago

  • Resolution → fixed
  • Status reopened → closed

In 41634:

Embeds: In switched state, restore previous state if no post ID is found.

Fixes #40673.

Note: See TracTickets for help on using tickets.