WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.2k forks source link

Invalid configuration of 'WP_POST_REVISIONS' causes 'Updating failed.' (solved by setting 'always_populate_raw_post_data' to -1 in php.ini) #3102

Closed atachibana closed 6 years ago

atachibana commented 7 years ago

Issue Overview

Gutenberg 1.0.4 Invalid configuration of 'WP_POST_REVISIONS' causes 'Updating failed.'

In wp-cofig.php file, I had defined 'WP_POST_REVISIONS' under the require_once of wp-settings.php.

require_once ABSPATH . 'wp-settings.php';
define( 'WP_POST_REVISIONS', 3);

In this environment, Gutenberg V1.0.4 repeatedly warns 'Updating failed.', and nothing can be done.

This is my fault. WP_POST_REVISIONS must be put before wp-settings.php loading. In fact, WP_DEBUG notifies 'Constant WP_POST_REVISIONS already defined'.

But Gutenberg V1.0.1 worked successfully, and this error made me wonder this weekend.

If it is possible, please handle this issue.

Steps to Reproduce (for bugs)

  1. In wp-config.php, insert 'WP_POST_REVISIONS' as below:
    require_once ABSPATH . 'wp-settings.php';
    define( 'WP_POST_REVISIONS', 3);
  2. Open Gutenberg screen, and edit something.
  3. Wait for a while. You'll see 'Updating failed.' on the top of the scrren.

Browser

Expected Behavior

'Updating failed." should not be displayed.

Current Behavior

Repeatedly 'Updating failed.' is displayed.

Possible Solution

Related Issues and/or PRs

Error is the same, but don't know. Information is not enough...

Todos

jeffpaul commented 6 years ago

@atachibana there are some other REST-related issues being triaged, but would like to see if you can test and see if this is still an issue for you. If so, please add any additional information from your re-test... thanks!

atachibana commented 6 years ago

@jeffpaul

Thank you for the reminder. I close this defect because this issue seems to be fixed.

Environment:

Thanks

atachibana commented 6 years ago

@jeffpaul

I am very sorry. Previous trial was my failure. I modified wrong wp-config.php :-(

Still this issue remains in this combination:

NOTE: I want to emphasis that this error caused by my wrong setting as described in the above. Please feel free to close this item as user error.

gutenberg_2 0_update_failed

roytanck commented 6 years ago

I ran into this issue with (an older version of) XAMPP on Windows, and I fixed it by setting 'always_populate_raw_post_data' to -1 in php.ini.

Before uncommenting that line, I got this in the request's reponse data:

Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b>

ghost commented 6 years ago

I'm getting this error too with version 3.3.0 with the post revisions set to 5 in wp-config.

danielbachhuber commented 6 years ago

Closing, as the root cause for this error seems to be that PHP notices can break REST API responses. This is a known issue that we don't have immediate plans to address.

Related #4936