Without this else if the change from text to dropdown fails but no actual query is made since the query to update the attribute type gets made by the save_definition function.