WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 4 weeks ago

#53458 closed defect (bug) (fixed)

Incorrect variable name used in `get_block_editor_settings()`

Reported by: johnbillion Owned by: desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Editor Keywords: has-patch has-unit-tests commit dev-reviewed fixed-major
Focuses: Cc:

Description

The get_block_editor_settings() function attempts to read values from a variable called $settings which does not exist, meaning these three blocks are all dead code: https://github.com/WordPress/wordpress-develop/blob/c23452730188cc371effedd19493a8d50d3031dd/src/wp-includes/block-editor.php#L313-L339

Change History (16)

This ticket was mentioned in PR #1397 on WordPress/wordpress-develop by mukeshpanchal27.


6 weeks ago

  • Keywords has-patch added

#2 @mukesh27
6 weeks ago

PR #1397 added.

Feel free to update or let me know if any changes are required.

#3 @SergeyBiryukov
6 weeks ago

Introduced in [51149].

Would it be possible to write a unit test for this?

#4 @desrosj
6 weeks ago

  • Keywords needs-unit-tests added

The fix looks fairly straight forward. I'd like to get the fix in prior to beta 3, so going to commit.

The unit test can be added after to help prevent a regression in the future.

#5 @desrosj
6 weeks ago

In 51213:

Editor: Correct variable names in get_block_editor_settings().

Incorrect variable names were leading to unreachable conditional statements.

Follow up to [51149].

Props johnbillion, mukesh27.
See #53458.

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


5 weeks ago

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


5 weeks ago

This ticket was mentioned in PR #1462 on WordPress/wordpress-develop by felipeelia.


4 weeks ago

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

Add test for 53458

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

#10 @felipeelia
4 weeks ago

Hopefully, it is not too late for that PR! Let me know if you'd prefer any other strategy to test it or if any change in the code is needed. Thanks in advance!

#11 @desrosj
4 weeks ago

  • Owner set to desrosj
  • Status changed from new to reviewing

#12 @desrosj
4 weeks ago

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

In 51369:

Tests: Expand tests for get_block_editor_settings().

This adds unit tests to ensure get_block_editor_settings() properly maps some previously experimental features to their correct locations in the array of contextualized block editor settings returned by the function.

Follow up to [51149], [51213].

Props felipeelia.
Fixes #53458.

#13 @desrosj
4 weeks ago

  • Keywords commit dev-feedback fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to backport [51369].

#15 @SergeyBiryukov
4 weeks ago

  • Keywords dev-reviewed added; dev-feedback removed

Looks good to backport.

#16 @desrosj
4 weeks ago

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

In 51376:

Tests: Expand tests for get_block_editor_settings().

This adds unit tests to ensure get_block_editor_settings() properly maps some previously experimental features to their correct locations in the array of contextualized block editor settings returned by the function.

Follow up to [51149], [51213].

Props felipeelia, SergeyBiryukov.
Merges [51369] to the 5.8 branch.
Fixes #53458.

Note: See TracTickets for help on using tickets.