Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years 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
3 years ago

  • Milestone changed from Awaiting Review to 5.9.1

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


3 years 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.


3 years ago

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


3 years ago

#7 @jorgefilipecosta
3 years 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
3 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport

#9 @jorgefilipecosta
3 years 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.