Make WordPress Core

#59391 closed defect (bug) (fixed)

Undefined variable used in Tests_Blocks_Editor::filter_set_block_editor_settings_post

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

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 11 months ago.

Download all attachments as: .zip

Change History (5)

@david.binda
11 months ago

#1 @mukesh27
11 months ago

  • Component changed from General to Editor
  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 6.4
  • Owner set to costdev
  • Status changed from new to 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
11 months ago

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

#3 @costdev
11 months ago

  • Version set to 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
11 months ago

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