Restrict access options not copying over in bulk upload of courses

Restrict access options not copying over in bulk upload of courses

by Kathryn Woodhead -
Number of replies: 6

Hello, I have moodle v3.6.2 and adaptable theme.

I have to upload multiple courses using csv and I tried using the 'template' option and also by adding a backup file.

The activities/ content copies over but I need it to also copy the 'restrict access' settings for each activity. For example, I have downloaded this plugin: https://moodle.org/plugins/availability_role which allows me to choose 'Restrict access unless role = XXX'

How can these availability settings also be copied over?


Thanks,

Kathryn

Average of ratings: -
In reply to Kathryn Woodhead

Ri: Restrict access options not copying over in bulk upload of courses

by Paola Vaccari -

Hi Kathryn,

I have moodle v3.8, and I haven't the same problem with the Reservation activity, I didn't check with other activities, but I have a similar problem over the "restrict access" on a section/topic when I upload multiple courses using csv file and the mbz file as "template". I have more than a hundred of courses to upload!

I was hoping someone could help us...


In reply to Paola Vaccari

Re: Ri: Restrict access options not copying over in bulk upload of courses

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Does the MBZ course template have the restriction set?
In reply to Gareth J Barnard

Ri: Re: Ri: Restrict access options not copying over in bulk upload of courses

by Paola Vaccari -

Yes, of coure!

In reply to Paola Vaccari

Re: Ri: Re: Ri: Restrict access options not copying over in bulk upload of courses

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Does the restriction appear when you restore the MBZ course template as a normal course restore by itself?

What are the steps I need to take to replicate this?  With examples of input data please.
In reply to Gareth J Barnard

Ri: Re: Ri: Re: Ri: Restrict access options not copying over in bulk upload of courses

by Paola Vaccari -

Hi Gareth,

yes, when I restore the MBZ course template as a normal course restored by itself the restriction appears.

Here it is my procedure:

Logged as moodle administrator I use "Site administration - Courses - Upload courses" to upload all my courses using a csv file with this fields:

shortname,    fullname,    category_idnumber,    summary,    enrolment_1,    enrolment_1_role

I have 2 types of restrictions, the first is on the topic "Iscrizione Esami", and the other are on the "Reservation" activities used for the exam sessions.

In the upload process I choose for "Restore from this file after upload" my MBZ file (attached below) created from the course "2019/2020 - AAA Esempio"

After the process I obtain a course like "2019/2020 - Corso di test  n.200"

You can see the courses pages in the attached Courses.pdf file.

It keeps all the things, including the restriction on the Reservatin activities, but not the restriction on the "Iscrizione Esami" topic.

I hope this time my situation is more clear, and I bag your pardon for my English.

In reply to Paola Vaccari

Re: Ri: Re: Ri: Re: Ri: Restrict access options not copying over in bulk upload of courses

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, I could replicate with backup-aaa_esempio.mbz, but then when I tested with a test course I created with one restriction and used the same CSV format then it worked.  So, when restoring backup-aaa_esempio.mbz manually I get:

Invalid get_string() identifier: 'pluginname' or component 'reservation'. Perhaps you are missing $string['pluginname'] = ''; in mod/reservation/lang/en/reservation.php?
line 353 of \lib\classes\string_manager_standard.php: call to debugging()
line 7298 of \lib\moodlelib.php: call to core_string_manager_standard->get_string()
line 202 of \backup\util\ui\renderer.php: call to get_string()
line 384 of \backup\util\ui\restore_ui_stage.class.php: call to core_backup_renderer->backup_details()
line 163 of \backup\restore.php: call to restore_ui_stage_confirm->display()

therefore I suspect that because mod/reservation is not installed this causes the problem.