airesvsg / acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API
https://wordpress.org/plugins/acf-to-rest-api/
1.33k stars 111 forks source link

Cannot update taxonomy terms #301

Open ggeorg0p opened 5 years ago

ggeorg0p commented 5 years ago

Trying to update a term's custom field (either custom taxonomy or just the default categories taxonomy) always returns: "code": "cant_update_item"

JSON input is:

{
    "fields": {
        "deskpro_id": "21"
    }
}

Fyi, there is no authentication problem, as I can perform other actions on rest, eg edit posts.

MarcHoelzenbein commented 5 years ago

Exact same issue. Wordpress Version is 5.2.1 in my case.

All other POST/PUT requests for posts etc. are working fine. Trying to update (or create) those exact same acf fields using taxonomies doesn't work and creates this error.

This is an issue for both the classical "category" aswell as custom taxonomies.

MarcHoelzenbein commented 5 years ago

Does not work with Wordpress Version 4.9.10 either

MarcHoelzenbein commented 5 years ago

Any solution to this problem yet? Using the JWT Authentification (in case this is relevant).

airesvsg commented 5 years ago

Hi,

Authentication is necessary to edit or create, it's also depends if you have the privilege for it.

Thanks

ggeorg0p commented 5 years ago

Hey, I don't think it has to do with authentication. In my case, all other updates work. Even acf for posts work. However acf taxonomies update doesn't work.

ArchibaldArt commented 5 years ago

HI! Exactly the same problem. Posts acf setting/getting works well, but category acf update doesn't. 500 response with data:

{
  "code": "cant_update_item",
  "data": {
    "status": 500
  },
  "message": "Cannot update item"
}

ACF to REST API version 3.1.0 Advanced Custom Fields version 5.8.1 WP version 5.2.1

codemadan commented 5 years ago

Getting Same Error

{
  "code": "cant_update_item",
  "data": {
    "status": 500
  },
  "message": "Cannot update item"
}
MarcHoelzenbein commented 5 years ago

Still running into the same issue with an entirely new installation:

domain.com/wp-json/acf/v3/taxonomy/20

results in:

{
    "code": "cant_update_item",
    "message": "Cannot update item",
    "data": {
        "status": 500
    }
}

when disabling JSON Basic Authentication, I get an actual 401:

{
    "code": "rest_forbidden",
    "message": "Du bist leider nicht berechtigt, diese Aktion durchzuführen.",
    "data": {
        "status": 401
    }
}

Changing normal non-acf fields works as expected (Returns updated Item with Auth, Returns 401 without Auth)

I tested this issue with JWT Authentication aswell and got the same issue. Tested Only using admin informations.

If there's a different authentication method to compatible with the plugin, I'm all ears.

swash13 commented 5 years ago

same issue here with JWT authentication. Anyone found the problem and how to solve it ?

loq24 commented 4 years ago

Same issue here when updating user custom fields with JWT authentication

akelmj commented 4 years ago

Same issue , work with post type , not with taxonomy. Pods plugin work with taxonomies.

ukdesignservices commented 4 years ago

Also got the same issue. POST fields is working for posts + custom post types, but failing on term fields:

localhost/wp-json/acf/v3/product-category/759

{
    "code": "cant_update_item",
    "message": "Cannot update item",
    "data": {
        "status": 500
    }
}
fehmi commented 4 years ago

It is pain.

OptionAutomator commented 4 years ago

Same issue here. Can update posts and JWT working fine but failing on Term. Anyone come up with a solution?

andrewminion-luminfire commented 3 years ago

Same issue here. Confirmed it’s not an authentication or authorization problem, but apparently a bug with ACF Pro resolving author_13 to the author taxonomy, term ID 13.

See https://gist.github.com/andrewminion-luminfire/6e432574d3016ff312337d27f9b5cde6 for a fix.

djoo commented 3 years ago

@andrewminion-luminfire I put the fix you mention and i stil have the same problem. Any idea ?