Update hooks.php

adding line to force the uid to be set on attributes, causing the following code to be escaped by further if conditions.