General developer forum

 
 
Picture of Patrick Verguet
Aliases working strangely?
 

Hello to everyone

I have to bother you with my question as I cannot seem to find an answer.

I have been trying to use aliases to duplicate an html (HotPot) exercise file located in My Private Files, to create exercises with different settings, the idea being that I could update the file once and have the change shown immediately in the various places where I have deposited the aliases.

It doesn't seem to work, and I have to add again the alias for the change to be reflected.

Still working with the original alias, if I download the alias, I get the new version. But it will not be displayed by Moodle. I have thought it might be because of the browser's cache, and cleared it, but no change (it did seem to work a couple of weeks ago for another file I would be calling with an absolute URL, as I wrote in another post.)

Now, here is the strange thing: if I open my Moodle exercise link (still with the original alias) under an obsolete IE6 (I (I work with Firefox and never downloaded the new IE), it sends some error messages, but it does show the new version of my file... So I thought I was onto something, but again, IE8 on another computer will display the old version.

Is there any way to force the update of the aliased file?

Thanks for any help or explanation.

 

 
Average of ratings: -
Picture of Patrick Verguet
Re: Aliases working strangely?
 

After some more checks, here's a complete breakdown of the situation:

I have 9 different exercises all supposed to be using the same html file; there have been several versions of the file 0929 - 1004 - 1004c -1005a, by order of creation, with the version number hard-coded on screen; aliases have been created or recreated at various dates. Here is what I get from the same course using Firefox and IE6:

# date alias modified  version shown IE version shown Firefox  
1 04-oct 1005a 1004c  
2 04-oct 1005a 1004c  
3 04-oct 1005a 1004c  
4 04-oct 1005a 1004c  
5 29-sept 1005a 1004c  
6 29-sept 1004c 0929  
7 29-sept 1004c 1004  
8 29-sept 1005a 1004  
9 04-oct 1005a 1004  
         

Also I confirm that an external js file which is called on load will be updated if and only if I clear the browser's cache - which I definitely did.

Any suggestion?

 
Average of ratings: -
Picture of Gordon Bateson
Re: Aliases working strangely?
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Patrick,
could you try disabling the HotPot cache (Site admin -> Plugins -> Activity module -> HotPot) and let us know if that changes what is displayed in each of the places where the file is used.

thanks
Gordon

 
Average of ratings: -
Picture of Patrick Verguet
Re: Aliases working strangely?
 

Thanks a lot for your answer, Gordon.

I will get in touch with my admin and check on that ASAP.

Patrick

 
Average of ratings: -
Picture of Patrick Verguet
Re: Aliases working strangely?
 

Hello again,

everything is fine and the latest version of the file is displayed in all places.

Sounds like magic - well, that's how it should be, shouldn't it?

Sorry if I should have known about this. blush

How can you explain that a different browser 'saw' something different?

Anyway, should I now convince my admin to leave it off? What is this cache used for? What are the consequences?

Thanks

Patrick

 

 
Average of ratings: -
Picture of Gordon Bateson
Re: Aliases working strangely?
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Hi Patrick,
it seems then that the HotPot module is not recognizing when a new version of a source file is available, and instead it is continuing to use the old version that it has in its own cache.

For the time-being, I suggest you leave the HotPot cache disabled. Although this will slightly increase the server load, it also means you will always get the latest version of the file. In the meantime, I will have a look at the HotPot module and see if the caching mechanism can be improved.

regards
Gordon

P.S. Note to the moderator of "General Developer Forum":
Please could you move this thread to the HotPot forum ?

 
Average of ratings: -
Picture of Patrick Verguet
Re: Aliases working strangely?
 

Hi Gordon

Many thanks for your quick answer. Solving this problem will make my life much easier by speeding up development and bug-correction time.cool

Please everybody accept my apologies for posting in the wrong forum.

Regards

Patrick

 
Average of ratings: -
Picture of Gordon Bateson
Re: Aliases working strangely?
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Hello again Philip,
I think I have now fixed the issue with the HotPot module not being aware of changes made to files in the Moodle file system.

Please could you upgrade your HotPot module and let me know if it works as you expect now.

thanks
Gordon

 
Average of ratings: -
Picture of Patrick Verguet
Re: Aliases working strangely?
 

Hello Gordon

sorry for the delay in answering.

I have asked my admin for this and will report back to you ASAP.

Regards

Patrick

 
Average of ratings: -
Picture of Patrick Verguet
Re: Aliases working strangely?
 

Hello Gordon

My admin updated to 2.5 on a test site and it works fine.

Thanks for the fix. This will save me quite a bit of time in the future.

Regards

Patrick

 
Average of ratings: -