WordPress.org

Make WordPress Core

#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
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.5.3
Component: Embeds Keywords: needs-patch
Focuses: multisite Cc:

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 15 months ago.
40673.diff (4.9 KB) - added by swissspidy 10 months ago.
40673.2.patch (906 bytes) - added by bor0 10 months ago.

Download all attachments as: .zip

Change History (15)

@imath
15 months ago

#1 @imath
15 months ago

  • Keywords has-patch has-unit-tests added

#2 @ocean90
14 months ago

  • Version changed from trunk to 4.5.3

@swissspidy How does 40673.patch look to you?

#3 @swissspidy
12 months ago

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

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


12 months ago

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


10 months ago

@swissspidy
10 months ago

#6 @swissspidy
10 months ago

  • Keywords commit added

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

#7 @swissspidy
10 months ago

  • Resolution set to fixed
  • Status changed from reviewing to 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
10 months ago

  • Keywords needs-patch added; has-patch has-unit-tests commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

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

@bor0
10 months ago

#9 @bor0
10 months ago

  • Keywords has-patch added; needs-patch removed

#10 @swissspidy
10 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 41606:

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

Props bor0.
Fixes #40673.

#11 @ocean90
10 months ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

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

#12 @ocean90
10 months ago

  • Resolution set to fixed
  • Status changed from reopened to 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.