Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#46358 closed defect (bug) (wontfix)

Any POST request doesn't output any errors in version 5

Reported by: developedbyme's profile developedbyme Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0
Component: General Keywords:
Focuses: rest-api Cc:

Description

Any POST to either a page or the Rest API doesn't output errors or after update to version 5.

If you have a fatal error it justs stops without outputting anything.

Configuration in wp-config.php
define('WP_DEBUG', true);
error_reporting(E_ALL);

In any file:
function_that_doesnt_exists();

Expected result (works in 4.9):
<b>Fatal error</b>: Call to undefined function function_that_doesnt_exists()

Actual result (in 5.0.3 and 5.1):
(no output at all)

Change History (3)

#1 @earnjam
6 years ago

  • Version changed from 5.1 to 5.0

Hi @developedbyme and welcome to Trac!

This was an intentional decision to prevent malformed REST API responses whenever errors or warnings are thrown. See #44534 for more information.

You should still be able to see any errors in an error log. They just won't be displayed in the response.

Can you shed some more light on the type of POST to a page you are doing where they are not displaying? Is it a JSON request that contains Accept or Content-Type headers of application/json?

#2 @developedbyme
6 years ago

Thanks for the explanation.

Yes it was a POST with the Content-Type header set to application/json.

#3 @earnjam
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks for the follow up. I'm going to close as wontfix since this was the intentional design.

If you have additional information, or thoughts about how we might change or improve this, feel free to add to the ticket and we can revisit.

Note: See TracTickets for help on using tickets.