When I log in, or load a user resource, and the site has user account pictures enabled, this is what I get for the user picture:
<picture>
<fid>13</fid>
<uid>7</uid>
<filename>picture-7-1366818948.jpg</filename>
<uri>public://pictures/picture-7-1366818948.jpg</uri>
<filemime>image/jpeg</filemime>
<filesize>46528</filesize>
<status>1</status>
<timestamp>1366818948</timestamp>
</picture>
There is no way of getting a URL for the picture from the above. The best thing there is the URI, public://pictures/picture-7-1366818948.jpg, but that requires knowledge of what the 'public://' resource corresponds to, which is a piece of site configuration data -- not something a consumer of the service can assume.
Comments
Comment #1
joachim commentedHere's a simple patch that adds this in if user pictures are enabled.
Comment #2
kylebrowning commentedBecause this changes response and what people are expecting, it must use versions built into services.
Take a look at services.versions.api.php in services/docs
Or this code :P
yeah because if you change the user resource directly, peoples clients will break when they update Services.
As an example, this is in the user resource and lets admins choose the version they wish to use for the logout method.
Comment #3
marcingy commentedThis looks good it adds a new field called url so existing data is still in place. In my view no need for a new version.
Comment #4
kylebrowning commentedGood call marcingy, ignore #2
Comment #5
ygerasimov commentedCommitted.