Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
rest.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2013 at 21:41 UTC
Updated:
29 Jul 2014 at 23:03 UTC
Jump to comment: Most recent
Comments
Comment #1
effulgentsia commentedThat's a bug being worked on in #2050843: Users 0 and 1 are created without a UUID
From #1979260-18: Automatically populate the author default value with the current user:
Yeah, it would be good for us to add a test for that once this support request is answered.
Comment #2
anavarreI can confirm that behavior:
$ curl --include --request POST --user root:root --basic --header 'Content-type: application/hal+json' http://head.local/entity/node --data-binary '{"_links":{"type":{"href":"http://head.local/rest/type/node/page"}}, "title":[{"value":"Page posted as UID 1"}], "uid":[{"target_id":"1"}]}'Which returns:
So, node 10 should have UID 1 as the node author but it's UID 0 (anon) instead:
Comment #3
fenda commentedI'm also unable to figure out how to set a node author via the REST API. I've attempted the same POST syntax as shown in above comments in various combinations.
Comment #4
MartijnBraam commentedThanks for the report.
I followed your steps and this seems to be working with the patch from this issue applied: #2180109: Change the current_user service to a proxy
Comment #5
anavarreJust got to this issue again and I also confirm it now works fine. Thanks for the pointer @MartijnBraam!