Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#59105 closed defect (bug) (reported-upstream)

`blocks/footnotes.php` file overwrites global `$post_type` variable

Reported by: om4csaba Owned by:
Priority: normal Milestone:
Component: Editor Version: 6.3
Severity: major Keywords:
Cc: Focuses:

Description

The blocks/footnotes.php file in v 6.3 introduced a name collision with the global $post_type variable.

This name collision occurred because the blocks/footnotes.php file is not loaded within a function or method.

Now, WordPress sets the global variable in every context, such as the REST API, where this variable previously did not exist. As a result, any plugin or theme that relies on the global $post_type variable may experience a change in behavior.

See the impact on WooCommerce here: https://github.com/woocommerce/woocommerce/issues/39744

Changes introduced: [56298]
Related ticket: #58804

Change History (6)

#1 @isabel_brison
3 years ago

  • Milestone Awaiting Review6.3.1

#2 @swissspidy
3 years ago

  • Component Posts, Post TypesEditor

This will need to be fixed in the Gutenberg repo as the file lives there.

#4 @audrasjb
3 years ago

  • Milestone 6.3.16.3.2

WP 6.3.1 is going to be released in the next few days, so let's move this ticket to 6.3.2 to give it more time to be committed and backported.

#5 @om4csaba
3 years ago

Hi @audrasjb,

I've noticed that the changes were committed via [56423]. Given this, it seems that the issue has been addressed.

Therefore, might closing this ticket rather than changing the milestone be more appropriate? I believe this would accurately reflect the status of the issue.

Thank you

#6 @audrasjb
3 years ago

  • Milestone 6.3.2
  • Resolutionreported-upstream
  • Status newclosed

You're right, thanks!
Fixed in [56423].

Note: See TracTickets for help on using tickets.