Closed boxybird closed 5 years ago
Hi @boxybird
Hmm honestly I've not tried it with Gutenberg yet.. Could you enable WP_DEBUG and dig a little deeper on the errors you're getting and post back here?
With WP_DEBUG enabled the error appears to be a memory issue. The only message is "PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted".
To be sure it wasn't my local setup causing the lack of memory issue I added "define('WP_MEMORY_LIMIT', '2056M');" to wp-config.php. This should be more than memory and yet I still get the same error.
Hmm sounds like it could be an infinite loop or a memory leak of some other kind..
would you mind testing some stuff. Activate the plugin and then open up the plugin file simple-jwt-authentication/includes/class-simple-jwt-authentication-rest.php
and try to comment out one of the filter hooks in the __construct at a time and see wether the saving of a post starts to work or not after each.
I think it has to be one of those! Most likely either the determine_current_user
or rest_pre_dispatch
hooks.
You're right, it's the determine_current_user
hook.
I found the solution here: https://github.com/Tmeister/wp-api-jwt-auth/commit/3d61a660ade3637c79dd8f5acbdeaa0b0a30e798
@boxybird could you try out this branch and see if that does the trick for you :) https://github.com/jonathan-dejong/simple-jwt-authentication/tree/bugfix/gutenberg-leak
@jonathan-dejong Works beautifully! Thanks.
Great! I'ts been merged with master now :)
When the simple-jwt-authentication plugin is active and you try to save as draft or publish a post using Gutenberg, the network returns a 500 error and the editor displays either 'Updating failed' or 'Publishing failed'. If disabled, all is fine. Any thoughts?