Make WordPress Core

Opened 17 months ago

Closed 16 months ago

Last modified 16 months ago

#54900 closed defect (bug) (fixed)

PHP warning in `WP_REST_Global_Styles_Controller` if no `styles` exist in theme.json

Reported by: ntsekouras's profile ntsekouras Owned by: jorgefilipecosta's profile jorgefilipecosta
Milestone: 5.9.1 Priority: normal
Severity: minor Version:
Component: Editor Keywords: has-patch needs-refresh
Focuses: Cc:

Description

During this [GB PR](https://github.com/WordPress/gutenberg/pull/38124) I noticed a PHP warning in WP_REST_Global_Styles_Controller where we are assuming that every theme.json has styles property, which is not always the case.

It's fixed in GB now, but we should add this to 5.9 next minor release.

Change History (10)

#1 @SergeyBiryukov
17 months ago

  • Milestone changed from Awaiting Review to 5.9.1

This ticket was mentioned in PR #2224 on WordPress/wordpress-develop by ntsekouras.


17 months ago
#2

  • Keywords has-patch added

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

During this GB PR I noticed a PHP warning in WP_REST_Global_Styles_Controller where we are assuming that every theme.json has styles property, which is not always the case.
It's fixed in GB now, but we should add this to 5.9 next minor release.

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


16 months ago

#4 @audrasjb
16 months ago

  • Keywords needs-refresh added

As per today's bug scrub, this ticket needs some changes suggested by @jorgefilipecosta: https://github.com/WordPress/wordpress-develop/pull/2224#pullrequestreview-862640987

Adding needs-refresh keyword so the PR can be updated by @ntsekouras (or anyone, please feel free to send a new PR) and properly tested.

#5 @ntsekouras
16 months ago

I updated the PR and is ready to be reviewed/tested.

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


16 months ago

#7 @jorgefilipecosta
16 months ago

  • Owner set to jorgefilipecosta
  • Resolution set to fixed
  • Status changed from new to closed

In 52750:

Global Styles: Fix PHP warning in WP_REST_Global_Styles_Controller if no styles exist.

There is a PHP warning in WP_REST_Global_Styles_Controller because we are assuming that every theme.json has styles property, which is not always the case.

Props ntsekouras.
Fixes #54900.

#8 @jorgefilipecosta
16 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport

#9 @jorgefilipecosta
16 months ago

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

In 52751:

Global Styles: Fix PHP warning in WP_REST_Global_Styles_Controller if no styles exist.

There is a PHP warning in WP_REST_Global_Styles_Controller because we are assuming that every theme.json has styles property, which is not always the case.

Props ntsekouras.
Merges [52750] to the 5.9 branch.
Fixes #54900.

Note: See TracTickets for help on using tickets.