Problem/Motivation
A translation POST or PATCH whose body omits the langcode attribute is rejected with a confusing 422, even though the target language is unambiguous from the request metadata (?langCode=fr / Content-Language: fr):
Translation resource language mismatch: "fr" (request metadata) vs "en" (request payload).
The payload deserializes to the site default language when langcode is absent, and checkResourceLanguage() compares that default against the targeted language unconditionally. Sparse bodies (send only what changed) are the normal decoupled PATCH pattern, the module's own spec says the payload langcode "if present, MUST match", the OpenAPI submodule documents it as optional, and the collection-POST path already infers a missing langcode. The strictness also collides with field access: when a bundle's language setting is not alterable, echoing langcode in the payload can itself be rejected with 403, leaving no working way to write.
Steps to reproduce
Proposed resolution
checkResourceLanguage(), skip the comparison when the payload carries no langcode attribute (derive the public field name from the entity type's langcode key, the same pattern createIndividual() already uses). The mismatch rejection keeps firing verbatim whenever a langcode attribute IS present and disagrees.
Issue fork jsonapi_multilingual-3613674
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
lauriii