Moodle Course ID number issue...

Moodle Course ID number issue...

by Chris Keen -
Number of replies: 8
I'm curious to find out if the problem I'm having is being experienced by others. Is it a problem with Moodle, or am I just using it wrong?

At present, we have two (well, actually more, but let's say two for simplicity's sake) Moodle environments - the live environment the students are using and a development environment where we experiment, test, and develop courses. Courses developed or built in the development environment are pushed up to the live environment when they're ready to go live.

Now, when adding content to the course page (/course/view.php) I want to add, say, a summary with the HTML editor. If I want to add an image, I select an image through the file picker and it gets inserted. However, the path to the image contains the course id number in it. (... /file.php/courseid/ ...)

Do we see where this is going yet?

When we want to transfer the course up the live environment, it is backed up from the development environment and restored into the live environment as a new course. All the files, including the image in question, are carried across but the course now has a new id number. All the core Moodle functionality works fine, but the image I linked to now no longer exists. I have to manually edit the HTML entry and select the image again to get it assigned the new id number.

So, have other people experienced and had issues with this explicit id number referencing? How have you solved it? Is it more common to just perform course development on the live server, thus negating the need for the upload between environments? This goes against our current development policy so it would be nice to avoid this if possible.

To add a little extra spice into the mix, I recently built a custom FLV player for our Moodle. Using the parameters that are able to be passed in with a new link I passed in both the server path and the course id number. Then, using PHP and ActionScript I was able to create an FLV player page that can play any FLVs from the courses. As the course id number is passed in, it is dynamic and any clashing between the environments is non-existant.

I guess a perfect solution would be to have that id number generated into the image path dynamic so it can be flexible enough to be uploaded to a different course. Should I raise this issue in the tracker?

Thanks for any thoughts. smile

EDIT - We're running 1.9.3 in both environments. Thanks.
Average of ratings: -
In reply to Chris Keen

Re: Moodle Course ID number issue...

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I have come accross this problem and I never found a solution. Anyone else got a suggestion?
In reply to Chris Keen

Re: Moodle Course ID number issue...

by Eric Merrill -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
This has been a known issue for quite a while, and also affects things like questions that use an embedded image URL.

There are some work arounds, like adding a bit of text that scans all incoming text and replaces and course id number links with updated ones.

On a large scale (ie across all Moodle installs) this can be problematic. To the best of my knowledge, this will not be fixed in Moodle proper until 2.0 comes out, since there is a total rework of how files are handeled.

-Eric
In reply to Eric Merrill

Re: Moodle Course ID number issue...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Correct, this is one of the new features of the File API for Moodle 2.0.

We now have far greater correlation between texts and the images they contain, to make them easier to move around.

However, even in 1.9 for this case in question ... the backup/restore in 1.9.x SHOULD be rewriting those URLs ... if it isn't then that's a regression and should be reported in the tracker.
Average of ratings: Useful (1)
In reply to Eric Merrill

Re: Moodle Course ID number issue...

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Actually, I think I have finally fixed all of these problems with question backup and restore in quiz questions. However, if there are still bits that don't get handled properly, please file bugs in the tracker.
In reply to Tim Hunt

Re: Moodle Course ID number issue...

by Eric Merrill -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
I know I haven't looked at the question one in a while, so I'll believe you that it's fixed smile
Average of ratings: Useful (1)
In reply to Chris Keen

Re: Moodle Course ID number issue...

by Chris Keen -
Thanks everyone. I'll raise this issue in the tracker as Martin suggested. smile
In reply to Chris Keen

Re: Moodle Course ID number issue...

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi,

This (MDL-18222) should be working ok now. It was a matter of processing those summary links too early in the restore process (before the course itself has been created). Now it's executed later and seems to work ok.

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Moodle Course ID number issue...

by Vanessa Cleary -
Hello all,

I am not sure why I am having an issue with the image link staying static after a restore. We recently upgraded to 1.9.5 (Build: 20090515) and is now encountering this problem. Previously we were on 1.94 and did not have this problem.

Would it help if we upgrade to the most recent release?

Thanks,

Vanessa