Make WordPress Core

Opened 13 months ago

Closed 12 months ago

Last modified 12 months ago

#57716 closed task (blessed) (fixed)

Remove server-side redirection in site editor

Reported by: ntsekouras's profile ntsekouras Owned by: hellofromtonya's profile hellofromTonya
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: Editor Keywords: gutenberg-merge has-patch has-unit-tests commit
Focuses: Cc:

Description

Remove server-side redirection if missing postType and postId query args when visiting Site Editor.

This is not needed any more as the routing is handled client side.

Related GB PRs:

Testing instructions would be to click Appearance->Editor in WP admin and everything should work as before.

It requires this PR to land first: https://github.com/WordPress/wordpress-develop/pull/4070

Change History (17)

#1 @ntsekouras
13 months ago

#57715 was marked as a duplicate.

This ticket was mentioned in PR #4073 on WordPress/wordpress-develop by @ntsekouras.


13 months ago
#2

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/57716

Remove server-side redirection if missing postType and postId query args when visiting Site Editor.
This is not needed any more as the routing is handled client side.
Related GB PRs:

Testing instructions would be to click Appearance->Editor in WP admin and everything should work as before.
It requires this PR to land first: https://github.com/WordPress/wordpress-develop/pull/4070

#3 @hellofromTonya
13 months ago

  • Milestone changed from Awaiting Review to 6.2
  • Owner set to hellofromTonya
  • Status changed from new to reviewing
  • Type changed from enhancement to task (blessed)

Currently reviewing for Beta 2 commit.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


13 months ago

@hellofromTonya commented on PR #4073:


13 months ago
#5

https://github.com/WordPress/wordpress-develop/pull/4070 has been committed, unblocking this PR ✅

Currently reviewing for committing.

#6 @hellofromTonya
13 months ago

  • Keywords commit added

Patch: https://github.com/WordPress/wordpress-develop/pull/4070

Ready for commit 👍

Prepping commit now for Beta 2.

#7 @hellofromTonya
13 months ago

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

In 55338:

Editor: Remove missing postType and postId query args Site Editor redirect.

Removes the server-side redirection if missing postType and postId query args when visiting Site Editor. Why? This redirect is no longer needed as the routing is now handled client side (via [55333]).

References:

Follow-up to [55333], [53413], [53093].

Props ntsekouras, youknowriad.
Fixes #57716.

#9 follow-up: @johnbillion
12 months ago

@hellofromTonya @ntsekouras Can and should the _resolve_home_block_template() function be removed or deprecated? It's no longer used since [55338].

#10 in reply to: ↑ 9 @hellofromTonya
12 months ago

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

Replying to johnbillion:

@hellofromTonya @ntsekouras Can and should the _resolve_home_block_template() function be removed or deprecated? It's no longer used since [55338].

Good catch @johnbillion! The code in this ticket was added in [53093] including _resolve_home_block_template().

Can it be removed or deprecated?
Yes, I think so.

  • No longer used in Core or Gutenberg.
  • No instances in wordpress.org's plugin directory.
  • No instances in wordpress.org's theme directory.
  • It's marked private (internal Core usage).

Here's its doc page https://developer.wordpress.org/reference/functions/_resolve_home_block_template/.

Deprecate or remove?
I'd like to remove it as it's not used (see above), likely low BC risk given its specific use case, and not wired as a callback. But "likely low BC risk" concerns me. Leaning towards deprecating.

What do you think @johnbillion?

#11 @johnbillion
12 months ago

Yeah +1 to deprecating and adding a note to the description to say the function is no longer used.

This ticket was mentioned in PR #4143 on WordPress/wordpress-develop by @hellofromTonya.


12 months ago
#12

  • Keywords has-patch has-unit-tests added; needs-patch removed

Deprecate _resolve_home_block_template() which is no longer used in Core since 55338.

As there is no replacement function, none is suggested in the deprecation notice.

Trac ticket: https://core.trac.wordpress.org/ticket/57716

#13 @hellofromTonya
12 months ago

@johnbillion if you have time, can you do a confidence check on PR 4143?

#14 @johnbillion
12 months ago

  • Keywords commit added

#15 @hellofromTonya
12 months ago

Thank you @johnbillion. Prepping commit now.

#16 @hellofromTonya
12 months ago

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

In 55436:

Editor: Deprecate _resolve_home_block_template().

The internal Core-only _resolve_home_block_template() function was introduced in [53093] for a specific purpose of resolving the template for a site's home page. It was used as part of the Site Editor's redirect when the postType and postId query args were missing. The server-side handling was removed in [55338]. The function is no longer used in Core.

This changeset deprecates the function and removes its tests.

Follow-up to [55338], [53093].

Props johnbillion, hellofromTonya.
Fixes #57716.

Note: See TracTickets for help on using tickets.