In order for the environment_id to get set properly, you may need to change distributor to katello_distributor.  It may also require a change to javascript, if there is JS that is updating this hidden field.