Apply the select2 only when we have vocabularies in the form.

#6780 
@rbran100 The problem was that we didn't included the select2 library because there were no vocabularies attached to the form.