-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.21] role-import: moosh prevents importing roles with an empty archetype tag or without an archetype tag #472
Comments
Additional notes: moosh does import the role if it has no archetype tag at all. The role XML schema for Moodle allows the tag to not occur at all, see https://github.com/moodle/moodle/blob/462d5f04a8fea5e2aaa7911cc700f90d54b8a73b/admin/roles/role_schema.xml#L9. The possible solution would be to replace the lines at moosh/Moosh/Command/Moodle33/Role/Roleimport.php Lines 72 to 76 in 33e9bc4
with
|
Just tested a role file without even an empty archetype tag. Sadly it doesn't work either. Moodle's parse_preset functioon stores null in $importData['archetype']. You don't even check if there is any real value for the assoc array value (not even for null). So as long as your role doesn't have an existing of the 8 Moodle archetypes, you currently can't import role XML files with moosh. |
Probably solved by #473 |
Actual behaviour
Given a role at /path/to/roleNoArchetype.xml which contains the following empty archetype tag:
moosh import -f /path/to/roleNoArchetype.xml outputs
Moodle itself lets the admin import the role without any errors.
Expected behaviour
moosh should import the role without errors, just like Moodle does.
Steps to reproduce
The text was updated successfully, but these errors were encountered: