1

I am going to create a REST API using Drupal 8 Rest Export with Views. It is working fine so far. I am showing some fields from content type article and added contextual filters for language and tags.

I get results like this

[
   {
      "title": "Autem Camur Inhibeo Typicus",
      "field_tags": "restapi, test",
      "field_image": "http://localhost/drupal_8_api/sites/default/files/2016-12/gen5431.tmp.gif"
   }
]

I made every field of my article translatable except the tags (they should be the same in every language). This works fine, too, the correct translation is shown and the tags change for all translations if I change them in one translation (I have english and german right now)

My problem: When I filter by language it works fine and I get only german/english nodes. But if I filter for the tags and for german language I get no results. I could locate the problem a bit. If I set the tags-field to translateable, it works. So I think the problem might be that the german translation has no "own" tags and the filtering fails with this. The strange thing is that the JSON result is correct. (If I just filter for language I can see the correct tags in the german JSON)

Any help is appreciated (the tags should really not be translatable)

0

Pretty sure that's "just" yet another variant of the bug that this issue is trying to fix: Views should not condition joins on the langcode of fields that are not translatable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.