There is an error when duplicating courses which use the remui course format. The Remui course image does no longer exists after a duplication if the course setting page is open at the same time.
Steps to reproduce:
Checkout master branch
Install version (1.1.1)
create course
Set course format to remui
Add image to the remui section and save
Reopen course setting page and open a new tab
duplicate the created course over /backup/copy.php?id={courseid} (in the new tab)
Run cron job (terminal)
See that the new created course does not have a remui course image.
Most likely its based on the filearea context or a fresh generated draftid when editing the course page.
Because it works when none is editing the course. (must be explizit saved, a simple exit while editing the page does not work and will result also in an empty image)
There is an error when duplicating courses which use the remui course format. The Remui course image does no longer exists after a duplication if the course setting page is open at the same time.
Steps to reproduce:
Most likely its based on the filearea context or a fresh generated draftid when editing the course page. Because it works when none is editing the course. (must be explizit saved, a simple exit while editing the page does not work and will result also in an empty image)
The error exists somewhere in this function or below in the call chain. https://github.com/WisdmLabs/moodle-format_remuiformat/blob/master/lib.php#L639