Resource types

file resource, Content ID keeps changing upon saving

Health & Safety Training Ninja
file resource, Content ID keeps changing upon saving


I use the 'file' resource to upload a zip, then uncompress it.

Inside this zip are a number of files used for a swf animation.

The 'main file' is index.html, other components/js/xml etc are in subfolders.

I then link to the index.html using an iframe within any content area of that course i.e. within the 'lesson module' pages.

This method works great and have had no issues so far.

However! I have now discovered an issue and I'm pretty certain this cannot have been intended by design and I believe it to be a BUG. Before filing a bug report I'd like some feedback from others experience - perhaps there's something I'm missing.

The issue is this:

When a 'file type' resource is created and saved with the 'main file' set all is ok.

I'd leave it on 'automatic' for display option and set it to hidden.

I'd then look at the source code once the page has loaded of this file resource.

I'd copy the link to the resource from the below code snippet:

<object id="resourceobject" data="" type="text/html"  width="800" height="600"><param name="src" value="" />
    Click <a href="" >index.html</a> link to view the file.

So I'd copy this link:

I'd then use the editor in code view and use an iframe like so:

<div style="text-align: center;">
<h2><span style="text-decoration: underline;">Accident MED</span></h2>
<br /><iframe src="" frameborder="0" height="500" scrolling="no" width="650">
Please download the latest Flash Player</iframe>

Which again works absolutely fine and is great. The animating appears and all works brilliantly.

The issue occurs when I revisit the 'file type' resource, let's say I add a better description for my own notes (as it's hidden) and then 'save' the file type resource.

The issue is exactly this:

The url to the index.html file (main file) of the file type resource changes upon any save action!!!

So the url which was once:

Now becomes a new url, which has been incremented upon saving:

See the difference?

This happens every single time the file type resource is saved/amended.

Which in turn means I have to manually go through all the previous occurences and update to the new url to the main file.

Why Oh WHY this happens boggles my mind - Why would it? Why should it? I see no reasonable rationale for this approach and would suggest it's a BUG which keeps auto incrementing file type resources upon save.

It's left me pulling my hair out is the least I can say.

Does anyone know where in the code this causes the incrementation and I'll hack it up. It's not something I'm comfortable with and would like to see these links stay 'static'.

Any help on this issue would be fantastic! Hopefully soon as it's created a lot of work for myself.



Average of ratings: -