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.
What additional work would be required to enable this module to updated existing entities with image attachments?
Comment | File | Size | Author |
---|---|---|---|
#5 | 1273334-wrapper-structure-5.patch | 787 bytes | amitaibu |
Comments
Comment #1
dasjofrom the question it is not quite clear what exactly you want to accomplish, please elaborate more precisely :)
Comment #2
Dinesh Kumar Sarangapani CreditAttribution: Dinesh Kumar Sarangapani commentedHow Image fields and other media fields are exposed in service.Whether it should expose image URI?
I get only alt tag as shown below
Comment #3
dgtlmoon CreditAttribution: dgtlmoon commentedI can confirm the same problem, essentially the poster is saying their content field (file/image) is not showing any data
example where field_picture has data when loaded through the HTTP GET browser stylee, but not 1.json RESTws stylee
{"nid":"2","vid":"2","is_new":false,"type":"picture","title":"funny","language":"und","url":"http:\/\/d7services.localhost\/node\/2","edit_url":"http:\/\/d7services.localhost\/node\/2\/edit","status":"1","promote":"0","sticky":"0","created":"1325697881","changed":"1325697881","comment":"2","comment_count":"0","comment_count_new":false,"body":[],"field_picture":[]}
Comment #4
amitaibu1) Create a node with a file/ image
2) Query node (e.g. node/1.json) -- the file info with the file ID isn't there.
Comment #5
amitaibuPatch fixes the problem by changing the IF statement, as EntityStructureWrapper's value can be retrieved by $property->value() as EntityValueWrapper does.
Comment #6
klausiHm, this workaround does not look right to me. Why does the EntityStructureWrapper not contain any property information? Just using the value of the structure wrapper would work for array structures, but if this is some other kind of structure (object?) then we would run into a problem.
Comment #7
amitaibuSorry klausi, I didn't understand your comment.
Are you able to get file info without the patch?
Comment #8
klausiDigging into this I found that the access handling of files is broken, that's why the file field is omitted. This is a known issue of entity API: #1136356: Fix file access (and this has been an issue in RESTWS some time ago, I just forgot about it, sorry).
Comment #9
klausiReopening to track this as Sebastian will work on it during GSoC.
Comment #10
sepgil CreditAttribution: sepgil commentedThe Entity API Issue #1136356: Fix file access was fixed and therefore image and other file fields should now be included in responses.