rage / mooc.fi

https://mooc.fi
5 stars 6 forks source link

"Inherit settings from" throwing an error #399

Closed Redande closed 4 years ago

Redande commented 4 years ago

I'm trying to create a course for "Ohjelmoinnin MOOC 2020, Ohjelmoinnin jatkokurssi", which would inherit settings from "Ohjelmoinnin MOOC 2020".

While creating the course, any of the required fields can't be empty. If I try to enter the same slug that "Ohjelmoinnin MOOC 2020" uses, the page complains that the slug is already in use. If I try to use some other slug, I get the following error:

Virhe tallennettaessa: GraphQL error: Variable '$data' expected value of type 'CourseCreateInput!' but got: {"name":"Ohjelmoinnin MOOC 2020, Ohjelmoinnin jatkokurssi","slug":"ohjelmoinnin-mooc-2020-ohja","ects":"","start_point":false,"promote":false,"hidden":false,"study_module_start_point":false,"status":"Upcoming","teacher_in_charge_name":"Erkki Kaila","teacher_in_charge_email":"erkki.kaila@helsinki.fi","support_email":"","start_date":"2020-03-01T00:00:00.000+02:00","end_date":"2100-01-01T00:00:00.000+02:00","study_modules":{"connect":[]},"course_translations":{"create":[{"id":null,"name":"Ohjelmoinnin MOOC 2020, Ohjelmoinnin jatkokurssi","language":"fi_FI","description":"","link":""}]},"open_university_registration_links":{"create":[]},"course_variants":{"create":[]},"course_aliases":{"create":[]},"inherit_settings_from":{"connect":"c06f937a-8531-48d4-b476-f69455cd1ed6"},"has_certificate":false,"photo":null,"completions_handled_by":null}. Reason: 'inherit_settings_from.connect' Expected 'CourseWhereUniqueInput', found not an object. (line 1, column 11): mutation ($data: CourseCreateInput!) { ^

mipyykko commented 4 years ago

Slugs must be unique, I think that's how it supposed to work. Fixed the inherit settings bug when creating course.