Fixed PHP error when editing custom fields on an attachment

Signed-off-by: Elliot Condon <e@elliotcondon.com>