Change categories when editing a rule

#165 
$parent_id is undefined