Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Trying to post a file entity that have fields adds the file but fails to write field data on the file entity. For example, I have a file entity with an field called alt_text. When I post a file to the file resource create endpoint I get the file created but the field value fails to save.
Example post:
{
"file": "somebase64data",
"filename": "images.jpg",
"field_file_image_alt_text": {
"en": [{
"value": "test",
}]
}
}
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#4 | services-file_field_save_entity-2912489-4-7x.patch | 975 bytes | awm |
file_field_save_entity.patch | 975 bytes | awm | |
Comments
Comment #2
awm CreditAttribution: awm commentedComment #3
awm CreditAttribution: awm commentedComment #4
awm CreditAttribution: awm commentedupdating the patch file name to adhere with standards.
Comment #5
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedThis looks good, thank you. I can personally RTBC this pretty soon, as I suspect I'll need this patch for a ongoing project. Until then, if we can get 1 or 2 others to RTBC it, we'll get this committed.
Comment #6
Samvel CreditAttribution: Samvel at DrupalJedi commentedHi @tyler.frankenstein and @awm.
I reviewed patch on fresh drupal installation and test this issue. Patch working, and i can set RTBC to it.
Thank you for your work. I hope it will be committed.