Opencast-Moodle / moodle-block_opencast

Block to manage Opencast publications in moodle
22 stars 27 forks source link

Backup/Import improvements (series/episode selection + modules fix) #362

Closed ferishili closed 4 months ago

ferishili commented 6 months ago

This PR fixes #193

Description

Currently there is no possibility to select series and episode in course import wizard when selection "Duplicate Event" as import mode, and then the entire series and its events in a course will be imported. Apart from that, after the import is completed if you have also imported LTI modules or Activity modules, they also get imported in the new course, but they are still pointing to the event or series from the source course that everything has been imported from.

How it works.

How does the fix methods work:

the whole concept is that the newly created course after import contains modules that has series/event id from the old course. Therefore, the only goal is to collect the newly created series id, or duplicated event id and replace them in the modules (if any) of newly created course.

NOTE

Please refer to https://github.com/Opencast-Moodle/moodle-block_opencast/issues/193#issuecomment-1958978574 This PR will fix: https://github.com/Opencast-Moodle/moodle-mod_opencast/issues/34 as well

ferishili commented 6 months ago

Hi @mwuttke, Please test this PR again, and write your feedback, so we can proceed with merging it. Thanks in advance.

mwuttke commented 6 months ago

@ferishili: My tests are successful. I made a bulk import with a new course and one with an old reseted course, using the duplicate workflow, and it works as expected.

We used for the test Opencast Version 14.4/15.3 and Moodle Version 4.1.9+.

ferishili commented 5 months ago

Hi @justusdieckmann, Sorry to hear that, and hope you've healed and are well now.

Thanks for your review, I will try my best to apply the changes as soon as possible. Best Regards Farbod

ferishili commented 5 months ago

Hi @justusdieckmann, Thanks again for the review, the changes are applied, and open (unresolved) changes are waiting for your reply.

Best Regards

justusdieckmann commented 5 months ago

Hi @ferishili,

thank you, I replied to all comments!

Kind Regards Justus

ferishili commented 5 months ago

Hey @justusdieckmann, the changes are there, thanks a lot. Hope they work fine, and I did not miss something!

BR

ferishili commented 4 months ago

Hey @justusdieckmann, Is there something else left to do here?

justusdieckmann commented 4 months ago

Could you look at this in Moodle 4.4? I always get the error 'Your settings have been altered due to unmet dependencies' but can't find the specific cause.

ferishili commented 4 months ago

Hi @justusdieckmann, as I mentioned this in last community meeting, this PR was promised and delivered only for Moodle up to 4.3! Let's merge this PR first and then we tackle the issues regarding refactoring for Moodle 4.4 in separate issue.

NinaHerrmann commented 4 months ago

Hey @ferishili as said in the meeting we wanted to have the PR for the 4.4 Release. Therefore, we need it to be 4.4 ready.

justusdieckmann commented 4 months ago

Hey @ferishili,

if it would just be refactoring and code style fixes, I would agree. I actually was holding off creating and merging the code style fixes for 4.4 in order to not create more hassle and merge conflicts for you, since 4.4 for example wants to have the language strings sorted alphabetically by key.

But this seems to be a functional bug which completely prevents imports in 4.4. Moodle 4.4 has been released for a few weeks now and we want to release a 4.4 version as soon as possible, so if we already found this bug here, it really doesn't make sense to delay fixing it

justusdieckmann commented 4 months ago

Hey @ferishili,

I've added a fix, does it look good to you?

ferishili commented 4 months ago

Hey @justusdieckmann, Thanks, I have tested the fix for Moodle 4.4, unfortunately it throws error stating error/setting_locked_by_config in Moodle 4.1! @mwuttke would you please test this on your test instance (Moodle 4.1 if I am not mistaken)?

justusdieckmann commented 4 months ago

Hey @ferishili,

that's weird, I have tested it on Moodle 4.1 and no error occured

mwuttke commented 4 months ago

Hello @ferishili,

I was also unable to detect any errors during my tests with Moodle 4.1 of this pull request.

ferishili commented 4 months ago

My scenario that ends up with that error: (Moodle 4.1)

ferishili commented 4 months ago

As video:

https://github.com/Opencast-Moodle/moodle-block_opencast/assets/53179227/02b8d9ba-a16f-45a1-88e7-83751dd1bc97

justusdieckmann commented 4 months ago

Do you have a stacktrace for me @ferishili?

ferishili commented 4 months ago

Not at the moment, let me see what I can do tomorrow!

justusdieckmann commented 4 months ago

I've just had a look through the rest of the code, and I think it isn't really a problem with 4.1, but rather the ACL mode. I've pushed a commit and I believe the error should not occur anymore

ferishili commented 4 months ago

Hey @justusdieckmann, thanks for the fix, However, your fix now ends up providing a logical bug!

By "ACL Change" as for importmode and "Unchecked" as for importvideoscoredefaultvalue, the episodes are now getting the RED "X" no matter if you select the series to import or leave it unchecked, which is logically incorrect because it creates a big misunderstanding from UI/UX point of view.

IMHO they should always remain checked with green tick to avoid any confusion! The Help tooltip icon is also there to explain the logic!

Your opinions here are most welcome @mwuttke @justusdieckmann

BR

mwuttke commented 4 months ago

Hello @ferishili, Hello @justusdieckmann,

I've tested this pull request again by using the "ACL Change" and the "Unchecked" mode. And I think Farbod is right with his comment. We normally use "Duplicating Events". So I had forgotten to look at the other variant.

justusdieckmann commented 4 months ago

Hey,

ok, so I'm not completely sure if moodle even supports that kind of dependency, because it seems a dependency always causes the child to be disabled if the parent has a specific value (I couldn't find a dependency without any functional implication), and disabled settings that are turned on initially (or locked in the on state) throw an error.

Honestly, I just didn't want to fight the dependency setting anymore, so I've just listed the videos in the series setting in ACL mode. Does this work for you? image

mwuttke commented 4 months ago

Hello @justusdieckmann.

It's not what I would expect in terms of look and feel, but it does what it's supposed to ;-)

Thanks a lot for your review!

And thanks a lot for you @ferishili for your work.

ferishili commented 4 months ago

Hi, Thanks @justusdieckmann and @mwuttke, From my side, that looks ok (it is not optimal, but it is acceptable), we could finally get this PR merged!

BR