MDL-41384 course: do not show debugging message if $COURSE contains format options

before showing debugging message make sure that field exists in database and not only in the object