When dragging a document, the reference was not populated

When dragging a document to the 'Documents' tab of a task, the reference in the document maintenance was not populated. As a result, the document was not correctly linked to the selected task.