Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#59391 closed defect (bug) (fixed)

Undefined variable used in Tests_Blocks_Editor::filter_set_block_editor_settings_post

Reported by: david.binda Owned by: costdev
Priority: normal Milestone: 6.4
Component: Editor Version: 5.8
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

The $allowed_block_types variable in https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/blocks/editor.php?rev=56559#L68 is not defined. IHMO, $editor_settings should have been used instead.

Attachments (1)

59391.diff​ (447 bytes ) - added by david.binda 3 years ago.

Download all attachments as: .zip

Change History (5)

@david.binda
3 years ago

#1 @mukesh27
3 years ago

  • Component General → Editor
  • Keywords has-patch commit added
  • Milestone Awaiting Review → 6.4
  • Owner set to costdev
  • Status new → assigned

Thanks @davidbinda for the ticket and PR.

It happened because the function was copied from above function filter_set_allowed_block_types_post.

Mark as commit

#2 @SergeyBiryukov
3 years ago

Good catch, introduced in [50776] / #52920.

#3 @costdev
3 years ago

  • Version → 5.8

Thanks for the ticket and patch @davidbinda, for the context @mukesh27, and for the history @SergeyBiryukov!

The patch looks good to go.

#4 @costdev
3 years ago

  • Resolution → fixed
  • Status assigned → closed

In 56619:

Editor: Fix parameter reference in block editor settings tests.

In [50776], the filter_set_block_editor_settings_post() callback was introduced for use in block editor settings tests.

This contained a reference to an $allowed_block_types parameter, which doesn't exist.

This changes the reference to $editor_settings.

Follow-up to [50776].

Props david.binda, mukesh27, SergeyBiryukov.
Fixes #59391.

Note: See TracTickets for help on using tickets.