General developer forum

core_course_delete_categories on Moodle Web Services

 
Picture of lucio beirao
core_course_delete_categories on Moodle Web Services
 

Hello.


i'm working with the Moodle Web Services using PHP and rest. The function i'm having problem is the core_course_delete_categories, which works fine with child categories, but gives me an error when deleting a 'root' category.


 The response i'm receiving is the following:

array ( 'exception' => 'moodle_exception', 'errorcode' => 'movecatcontentstoroot', 'message' => 'Mover o conteúdo da categoria para a raiz não é permitido. Você deve mover o conteúdo para uma categoria existente!', )


Can somebody give me a hint? I already tried to change the parameters, but without any success.


I was then thinking:  when deleting, i have to specify a valid new parent category in the newparent parameter? Because it's just not logical, and i'm stuck just in this thing i can't understand. If there is no known solution, maybe i'll create an issue in the Jira community.


 
Average of ratings: -