mAAdhaTTah / wordpress-github-sync

A WordPress plugin to sync content with a GitHub repository (or Jekyll site)
https://wordpress.org/plugins/wp-github-sync/
GNU General Public License v3.0
613 stars 99 forks source link

Post editing not possible anymore #194

Closed nasmi3 closed 6 years ago

nasmi3 commented 6 years ago

A strange bug happened, even without any other extension activated, when I try to edit an article within Wordpress, I get redirected to the corresponding Github .md file and not in the Wordpress editor.

I have no idea where does it comes from...

"failed with error: Invalid request. "sha" wasn't supplied."

mAAdhaTTah commented 6 years ago

when I try to edit an article within Wordpress

Are you navigating through the Admin screens to get to the editor? Can you be more specific as to the steps you took here?

nasmi3 commented 6 years ago

Yes of course, it happens either when I publish or update the post from the admin panel or when I try to click on edit from the "all page" view of the admin panel.

nasmi3 commented 6 years ago

Is there any possibility to get a log or something to see where do the problem exactly comes from ?

To me it semes to come from the fact that drafts (posts and pages) are not exported to github so the phugin can not find them on Github when trying to edit them again.

mAAdhaTTah commented 6 years ago

WPGHS writes log messages to the standard debug.log file that's normally placed in your wp-content folder. It only does so if WP_DEBUG is true.

nasmi3 commented 6 years ago

I managed to get rid of the 404 error of github by allowing the drafts to get saved to github by changing the line 31 from "wp-github-sync/lib/database.php"

from : protected $whitelisted_post_statuses = array( 'publish' ); to : protected $whitelisted_post_statuses = array( 'publish', 'draft' );

but the button "edit" from the wp-admin dashboard for posts and pages still leads to the Github's .md file : https://github.com/username/repository/edit/master/_drafts/2018-02-27-postname.md