When submitting a category form programatically there was an issue setting the parents correctly for nested categories. The parent would set to the cnid of the parent container. This patch fixes that issue for programatically submitting nested categories.

Ive tested this patch in my environment and it doesnt break anything. I cant be sure that it wont break other's configurations so use at your own risk.

- JLeider

Support from Acquia helps fund testing for Drupal Acquia logo