• Resolved swaip

    (@swaip)


    Hi, I use the latest versions of PODS Cms along with TranslatePress. Don’t know if this is a problem coming from one or the other, anyway.

    I have a site with two languages (en/fr), and a custom post type handled by PODS, with enabled connections to tags and categories.

    Both tags and categories work just fine in the primary language (English). Unlike custom fields, though, not only tags and categories are not automatically synced by TranslatePress, but they do not work at all while editing the custom post in the secondary language.

    So whenever I try to add a tag or category to the post in French, the tag or category is simply not added. I’ve also tried to unsync taxonomies in Translatepress settings, but with no luck.

    When I analyze the XHR in Chrome after trying to create a “doc” category, I see a call to /wp-json/wp/v2/categories?_locale=user with this result :

    {"id":69,"count":1,"description":"","link":"http:\/\/belea.local\/category\/doc\/","name":"doc","slug":"doc","taxonomy":"category","parent":0,"meta":[],"_links":{"self":[{"href":"http:\/\/belea.local\/wp-json\/wp\/v2\/categories\/69"}],"collection":[{"href":"http:\/\/belea.local\/wp-json\/wp\/v2\/categories"}],"about":[{"href":"http:\/\/belea.local\/wp-json\/wp\/v2\/taxonomies\/category"}],"wp:post_type":[{"href":"http:\/\/belea.local\/wp-json\/wp\/v2\/posts?categories=69"},{"href":"http:\/\/belea.local\/wp-json\/wp\/v2\/project?categories=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}

    Then I see a call to /wp-json/wp/v2/categories?context=edit&lang=fr&_locale=user with this response:

    {"code":"rest_forbidden_context","message":"Sorry, you are not allowed to edit terms in this taxonomy.","data":{"status":401}}

    Then I see a call to /wp-json/wp/v2/categories?context=view&per_page=100&orderby=name&order=asc&_fields=id%2Cname%2Cparent&lang=fr&_locale=user with this response:

    [{"id":1,"name":"Uncategorized","parent":0}]

    And no category “doc” is created for the foreign language post.

    Any ideas ?

    Thanks in advance

    • This topic was modified 1 year, 2 months ago by swaip.
    • This topic was modified 1 year, 2 months ago by swaip. Reason: Additional infos provided
Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter swaip

    (@swaip)

    IMPORTANT: the language plugin is POLYLANG, and NOT TranslatePress.

    Thread Starter swaip

    (@swaip)

    IMPORTANT FOLLOW-UP: I can still create tags from Posts > Tags or Projects > Tags in English, translate them into French and they WILL appear in French to be selected. But if I try to create a NEW tag inside the project in French, it will never work.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @swaip

    Sorry for this late reply.

    I honestly think there might be a different conflict here, did you test with only Pods and Polylang active?
    I use Polylang extensively myself and didn’t encounter this issue (yet).

    Cheers, Jory

    Thread Starter swaip

    (@swaip)

    Hi Jory, and thanks for writing back.
    The only other plugin I have is WP Migrate Lite. I will deactivate it and retest this, although I can hardly imagine this can be the origin of the problem.

    As soon as I migrate the site to production I can give you access to the test site, if you’d like to see for yourself.

    Anyway, thanks for your answer !

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @swaip

    Hmm, I also can hardly imagine that the migrate plugin would be an issue here. Did you also check with Polylang for CPT compatibility in the REST API?

    Cheers, Jory

    Thread Starter swaip

    (@swaip)

    Hi Jory,

    If you mean PODS Rest Api for this CPT here are my settings :

    https://pasteboard.co/dOWvyTIqW8xi.png

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @swaip

    Correct, but did you check whether Polylang supports this feature as well?

    Since it’s mostly about the taxonomies it sounds like this might be an issue with Polylang instead of Pods.

    And another option, since I see an unauthorizes issue, it might be that you don’t have all required capabilities set in all cases.

    Can you reproduce this behavior on a new (clean) installation?

    Cheers, Jory

    Thread Starter swaip

    (@swaip)

    I actually wrote on Polylang forum too, since I cannot say what’s the cause of the problem.

    But this WordPress was a clean slate, a portfolio with just this CPT, so I guess not much would change if I redo the installation.

    As for the capabilities, where should I look into ? I was the only (originary) administrator user.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @swaip

    Since Pods only registers the CPT (and Taxonomies) using WordPress core methods I’m inclined to wait for Polylang’s response on this issue.

    I think it’s fine but just to be sure.. what are the Pod settings? It everything public and is query var enabled?

    Cheers, Jory

    Thread Starter swaip

    (@swaip)

    It’s public, publicly querable, and query var is on. Did not touch these settings as far as I can remember.

    Let’s see if Polylang has something to say too…

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @swaip

    We havent heard from you anymore so I’m closing this topic.
    Feel free to reopen if you still need help!

    Cheers, Jory

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Translatepress tags and categories not working for custom post type’ is closed to new replies.