acf-to-rest-api icon indicating copy to clipboard operation
acf-to-rest-api copied to clipboard

Cannot update taxonomy terms

Open ggeorg0p opened this issue 6 years ago • 16 comments

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.

ggeorg0p avatar May 16 '19 09:05 ggeorg0p

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 avatar May 24 '19 14:05 MarcHoelzenbein

Does not work with Wordpress Version 4.9.10 either

MarcHoelzenbein avatar May 27 '19 08:05 MarcHoelzenbein

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

MarcHoelzenbein avatar May 29 '19 08:05 MarcHoelzenbein

Hi,

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

Thanks

airesvsg avatar May 29 '19 10:05 airesvsg

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.

ggeorg0p avatar May 29 '19 12:05 ggeorg0p

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

ArchibaldArt avatar Jun 15 '19 07:06 ArchibaldArt

Getting Same Error

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

codemadan avatar Jul 23 '19 10:07 codemadan

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

  • Installed Wordpress
  • Installed Advanced Custom Fields
  • Installed Custom Post Type UI
  • Installed JSON Basic Authentication
  • Installed ACF to REST API

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.

MarcHoelzenbein avatar Aug 08 '19 11:08 MarcHoelzenbein

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

swash13 avatar Aug 29 '19 07:08 swash13

Same issue here when updating user custom fields with JWT authentication

loq24 avatar Nov 25 '19 07:11 loq24

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

akelmj avatar Dec 15 '19 07:12 akelmj

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
    }
}
  • WP Version 5.3.2
  • Advanced Custom Fields PRO 5.8.7
  • ACF to REST API 3.2.0
  • Application Passwords 0.1.1

ukdesignservices avatar Feb 20 '20 10:02 ukdesignservices

It is pain.

fehmi avatar Apr 26 '20 19:04 fehmi

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

OptionAutomator avatar May 28 '20 21:05 OptionAutomator

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.

andrewminion-luminfire avatar Nov 25 '20 20:11 andrewminion-luminfire

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

djoo avatar Feb 12 '21 17:02 djoo