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
Images are missing in the grid boxes when restoring a course #172
Comments
What Grid version please.
|
The grid version is 400.2.0 - 2022072204 |
Copy course works (M4.0.5+ (Build: 20230105) - Grid 400.2.0). Importing won't as that is intentional as source images could overwrite destination images. Screen shot evidence of copy process along with steps to replicate please. |
Course backup and restore into a new course also work. |
We are experiencing that tiles images are only copied correctly if they are present in both image section and short description. Is that expected behavior? |
No. And my test only had the images in the image section and not the section summary, thus cannot replicate. And this used to be potentially possible with the M3.11- version, but has been fixed now. M4.0+ version is a re-write that does not have the issue in regards to the file area used for the image being the same as the one used in the section summary, and so if the same image was uploaded then could happen. |
Possibly related to comments by Michael Woods on https://moodle.org/plugins/format_grid. |
No reply in ages, closing. |
Hi again, |
@JRinggren No time frame, I tend to look at issues for non-clients when I get a moment or need the challenge of solving the problem. |
Hi again! |
Hi Gareth, happy to fund this Al |
@hovez701 can provide more details if you still have issues replicating |
@aspark21 Thanks, but need to be convinced that the correct issue is being solved as there seems to be two different scenarios going on here. The one that I could potentially address is when the user requests that the target course has its contents deleted. However that won't affect the this issue as that relates to course duplication, which I cannot replicate. G. |
Hi @gjb2048 , we are getting this issue from our course rollover plugin, which creates a new blank course first and then restores the backup into that new course. We believe this matches your scenario 1. |
@hovez701 Ok, so how can I programmatically detect that the target course is blank and that the contents require deleting? Do you tell the restore process what type of restore it is? Or rather, why don't you just instigate the duplication mechanism instead? |
Hi @gjb2048, It's always a blank course and restore using the moodle restore_controller. |
@aydevworks Thanks, I'll do some thinking. Where I can I get the 'course rollover plugin' from to test with please? Instructions etc. too. |
@gjb2048 Thanks, but could you please try to resolve this scenario first? Then we can test it from our side as the course rollover plugin required a few other plugins, a bit tricky to setup too. 😄 |
@aydevworks Ok. |
@gjb2048 Thank you! 🙏 |
Dear @aydevworks, After extensive research / trying to figure out how the restore API works, I've concluded that it is not possible to delete the existing files when deleting the content and before the images are restored from the backup, as no method that format can implement in its own restore classes will be called (unless there is a step / task that can be overridden - but I don't think so as the steps / tasks are course ones and not like for blocks / modules). This therefore also goes for a merge whereby the 'after_course' method is only called when the course settings change and thus on a merge to tidy up any restored files that are not used in the grid. Again, research wise, this does not seem to be the case when looking in the files table, however somehow when the 'delete content' option is chosen the files are used and work = odd! And on a merge when they are not, then they don't show in the files table, even though the restore mechanism -> 'process()' in 'backup/util/plan/restore_structure_step.class.php' indicates a 'files' restore process for the images that are in the backup file... unless, and I've yet to check, these were the old 'course/section' component/filearea files that are in my test courses before these recent changes and I've not breakpointed this in 'process' yet for a backup created from a new Grid course that doesn't have them. G |
P.S. Had to rebase as fixed a bug outside of this issue. |
P.P.S. Nope - "And on a merge when they are not, then they don't show in the files table, even though the restore mechanism -> 'process()' in 'backup/util/plan/restore_structure_step.class.php' indicates a 'files' restore process for the images that are in the backup file... unless, and I've yet to check, these were the old 'course/section' component/filearea files that are in my test courses before these recent changes and I've not breakpointed this in 'process' yet for a backup created from a new Grid course that doesn't have them." - tested and the files are being parsed - not sure what's going on. |
@hovez701 Any news on this from your end please? |
Feel free to continue looking into this for the other use cases @gjb2048 Seeing how painful this currently is, it may be useful to merge the partial fix for these use cases and expand on this in a further merge? |
@aspark21 Thanks. I thought you were on holiday? |
back for one day only and then off again 😄 |
Released in https://moodle.org/mod/forum/discuss.php?d=449513 - with merge (when no image in destination and image in source, then source image gets used) and delete. |
Is there any chance for a backport to 4.0? We are also affected by this in a similar context (using local_course_template plugin) and are on 4.0. |
Dear Eric,
If you fund my time, then yes.
G
|
@gjb2048 How much would that cost? Should I email you about this? |
@phette23 Between one to two hours at my current rate of 44 GBP per hour as I'll need to backport all of this: too, in order to keep things in sync + a Moodle dot org release. Please use the eMail address at the top of Support.md (https://github.com/gjb2048/moodle-format_grid/blob/master/Support.md) - note that I'm in the UK and I see you're in the US, so please let me know of any issues pertaining to your use of international contractors. |
When we copy courses, the images in tiles are missing.
The images are in the "Master" but not in the new course.
The same issue if we import into an existing course, the images in the tiles are missing.
We are currently on Moodle 4.0.4+ (Build: 20221018)
The text was updated successfully, but these errors were encountered: