Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Connecting to Wordpress issues #17

Open
botoxparty opened this issue Jan 4, 2019 · 3 comments
Open

Connecting to Wordpress issues #17

botoxparty opened this issue Jan 4, 2019 · 3 comments

Comments

@botoxparty
Copy link

Hey,

Really love that this is a project. Been playing around with it and i've been able to get it to connect successfuly and using authentication to WP API.

However some actions aren't working. e.g. I can't seem to add any categories/tags, publish content, or do anything with media.

Some of the requests coming from gutenberg look like this categories?per_page=-1&orderby=name&order=asc&_fields=id%2Cname%2Cparent

if i run this request in postman it fails because of the per_page=-1 . When i use gutenberg from within wordpress and i monitor the requests I see the same one being done with per_page=100 .

Also it says that you need permission to upload media. I'm definitely an admin and logged in.

Any ideas?

Best,
Adam

@botoxparty
Copy link
Author

Confirming that its the per_page=-1, if I modify the URL using an interceptor to be per_page=100 then i can receive categories and tags.

Not sure where -1 gets generated from. Guess i've got some exploring to do.

@botoxparty
Copy link
Author

botoxparty commented Jan 5, 2019

Okay so i can see that it was changed in Gutenberg to ask for -1, not sure why my Wordpress API doesnt support -1 i'm on the latest.

https://github.com/WordPress/gutenberg/pull/11654/files

Regarding the media uploads. Gutenberg calls to /wp/v2/media OPTIONS, it does so twice in my setup, one it returns GET as a method, the second time it returns GET and POST.

Not sure what to do for solutions.

@botoxparty
Copy link
Author

So i can force it to accept media uploads by calling data.dispatch("core").receiveUploadPermissions(true); manually. However the payload when it tries to send the file to /wp/v2/media is empty

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant