-
Notifications
You must be signed in to change notification settings - Fork 55
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
Cannot import activities between two courses using the Grid format #169
Comments
@jboulen Q - on your system is '3' the course id of the new course? |
my first course has id '2', general section id is '1', section 1 id is '2'. |
@jboulen Interesting, thanks. |
@jboulen Q, if you remove the lines 228 - 234 in /course/format/grid/backup/moodle2/restore_format_grid_plugin.class.php being:
then does the issue happen? As I'm now suspecting that:
above it could already be adding the records... to the gridimage table. |
@jboulen And does the image show please? |
Ok, solution breaks course duplication. |
@jboulen Please test 4769e4b - you can do a drop in replacement for https://raw.githubusercontent.com/gjb2048/moodle-format_grid/4769e4b9e48ca685a96961c311ea3ed06b5ae7bc/backup/moodle2/restore_format_grid_plugin.class.php. |
The original image for the second course has been preserved. However, when you edit section, there are two images in section image field (the original image and image used by the first course). |
It works. Activities have been correctly imported and there is only one image in section image field when you edit section. The section image in second course has been preserved. I think this is the desired behavior. It would probably be strange if the first course image was imported ? Thank you very much. |
@jboulen Thanks for letting me know. I looked at all my test courses that I created for this and couldn't see a second image. Logically perhaps it would make sense for the first course image to overwrite the second, but then the intent of the action is the content of the course and the image is a display thing. But as this is not a clear answer as some people will want the image overwritten and others not, then I'm going to leave as is. To overwrite the image will lead to even more complexity. |
environment :
moodle v4.0.4
grid 400.1.1
debian 11 (php 7.4 / mysql)
steps to reproduce :
workaround :
We can add this line in a try/catch to avoid the error. The import works, but maybe there is a side effect to ignore this exception...
The text was updated successfully, but these errors were encountered: