Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#53458 closed defect (bug) (fixed)

Incorrect variable name used in `get_block_editor_settings()`

Reported by: johnbillion's profile johnbillion Owned by: desrosj's profile 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.


4 years ago
#1

  • Keywords has-patch added

#2 @mukesh27
4 years ago

PR #1397 added.

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

#3 @SergeyBiryukov
4 years ago

Introduced in [51149].

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

#4 @desrosj
4 years 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
4 years 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.


4 years ago

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


4 years ago

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


4 years ago
#9

  • 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 years 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 years ago

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

#12 @desrosj
4 years 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 years ago

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

Reopening to backport [51369].

#15 @SergeyBiryukov
4 years ago

  • Keywords dev-reviewed added; dev-feedback removed

Looks good to backport.

#16 @desrosj
4 years 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.