- 🇭🇺Hungary Sweetchuck Budapest
The reason it does not work with
node:uid
is that,
perepopulate field values from query string only works when the field has no default value.
"Entity owner" field usually has a default value (current user), because of the BaseFieldDefinition::setDefaultValueCallback().Non empty fields can't be overridden from query strings.
See Populate::populateForm().When I temporally remove that condition and I use this query string
?edit[uid][widget][0][target_id]=42
then it looks good in the node create form. I did not press the "Save" button.I hope this information helps you to find a custom solution/workaround.
In my use case, I would like to make it easier for administrators to create a node for somebody else. They already have access to the "Authored by" field, just make sure they don't forget to change it.