Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks
atachibana opened this issue Oct 22, 2017 · 6 comments
Labels
Needs Testing Needs further testing to be confirmed.

Comments

@atachibana
Copy link
Contributor

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

  • On Widnows 10, XAMPP env, Chrome 61.0.3163.100
  • On Mac 10.13, VCCW env, Firefox 52.4.1 & Chrome 61.0.3163.100

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

  • Tests
  • Documentation
@jeffpaul jeffpaul added the [Status] Needs More Info Follow-up required in order to be actionable. label Jan 19, 2018
@jeffpaul
Copy link
Member

@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
Copy link
Contributor Author

@jeffpaul

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

Environment:

  • Windows 10, XAMPP env, Chrome 63.0.3239.132
  • WordPress Version 4.9.2
  • Gutenberg 2.0.0

Thanks

@atachibana
Copy link
Contributor Author

@jeffpaul

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

Still this issue remains in this combination:

  • Windows 10, XAMPP env, Chrome 63.0.3239.132
  • WordPress Version 4.9.2
  • Gutenberg 2.0.0

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

@atachibana atachibana reopened this Jan 22, 2018
@jeffpaul jeffpaul added Needs Testing Needs further testing to be confirmed. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Jan 22, 2018
@roytanck
Copy link

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
Copy link

ghost commented Jul 23, 2018

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

@designsimply designsimply changed the title Invalid configuration of 'WP_POST_REVISIONS' causes 'Updating failed.' Invalid configuration of 'WP_POST_REVISIONS' causes 'Updating failed.' (solved by setting 'always_populate_raw_post_data' to -1 in php.ini) Aug 20, 2018
@danielbachhuber
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

No branches or pull requests

4 participants