Broken links for external legacy html files with embedded files and images after upgrade 2.4 and 2.6

Broken links for external legacy html files with embedded files and images after upgrade 2.4 and 2.6

by Susan Mangan -
Number of replies: 3

Hi all, I have scoured the forums/documentation and found some similar issues but nothing that quite matches this.

I'm really hoping there's an expert kicking around that knows what might be going on here...

We recently upgraded to 2.6 in August.

We have one very large site that uses the Book module that was initially created years ago using 1.9. 

Within this Book module are pages that contain various links to external HTML pages that contain more embedded html files and images.  The instructor had most of the content already prepared before he started using Moodle so this is why he chose to simply upload the existing HTML files and related embedded files/images.  It all worked fine in 1.9 with the course file structure.

Since our most recent upgrade the links to all the external HTML pages in legacy files broke.  In the place of the file that was supposed to appear was the code from a php file which appeared to be a script to fetch legacy course files...

I manually re-linked the files  by editing the book module page and used the file picker and navigated to Legacy Files which is enabled in the course.  The re-linking worked fine but none of the embedded images/files are displaying in the pages.

I'm not sure what I'm missing here - what could have changed/broken this and how can I go about fixing all the missing embedded images and pages?  If there is a way...

Thanks in advance for any help.


Average of ratings: -
In reply to Susan Mangan

Re: Broken links for external legacy html files with embedded files and images after upgrade 2.4 and 2.6

by Derek Chirnside -

Shameless barrow pushing here Susan.

You may like to vote for this issue: https://tracker.moodle.org/browse/MDL-43996

Drag and Drop onto the editor of images would make this sort of relinking not needed, and problem solving easier.

By the way, have you checked the images can be inserted OK without using legacy files?  

-Derek

In reply to Derek Chirnside

Re: Broken links for external legacy html files with embedded files and images after upgrade 2.4 and 2.6

by Susan Mangan -

Thanks Derek - I'll check out that issue ...

Yes, I've tried various things to troubleshoot this including re-linking the files not using legacy files - the problem is - I have linked to HTML files in the pages of the book module and these HTML files contain embedded images and other HTML files.  It's these embedded images and files that are now broken. 

I believe the process of trying to re-link the initial  HTML page broke the internal embedded links however that page had to be re-linked somehow as it was generating an error - or not so much an error but it displayed the actual PHP code for calling legacy files rather than the actual file itself.  I figured re-linking would just fix this up but I was wrong.  I think I need to go back a step so the original linked HTML file uses the old technology looking at legacy files and do not re-link using file picker, but I'm not sure how to do this.

OR, I need to re-create all the link references in the HTML files but I don't know how to.... meaning I don't know what path to put in the file since there is no longer a direct path to the embedded files.  I thought using legacy files provided the ability to do this? 

Maybe this is a flaw with the Book module?  Or maybe I'm just missing something really simple.... I hope for the latter and that someone recognizes this and enlightens me!  If I haven't already confused the heck out of those who are reading this...



In reply to Derek Chirnside

Re: Broken links for external legacy html files with embedded files and images after upgrade 2.4 and 2.6

by Susan Mangan -

I think I need to try to explain this better.

I have copied below part of the script from the php file that shows up in the browser instead of the actual HTML page that is trying to display.

So for example the URL is:  http://moodle.capilanou.ca/file.php/11141/Hints/Hint-cylinder.htm

but what shows up is the code for a php file:


/**
 * This script fetches legacy course files in dataroot directory, it is enabled
 * only if course->legacyfiles == 2. DO not link to this file in new code.
 *
 * Syntax:      file.php/courseid/dir/dir/dir/filename.ext
 *              file.php/courseid/dir/dir/dir/filename.ext?forcedownload=1 (download instead of inline)
 *              file.php/courseid/dir (returns index.html from dir)
 * Workaround:  file.php?file=/courseid/dir/dir/dir/filename.ext
 *
 * @package    core
 * @subpackage file
 * @copyright  1999 onwards Martin Dougiamas (http://dougiamas.com)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */


Re-linking the original file (Hint-cylinder.htm) using the filepicker does work and the file then shows up BUT any previously embedded html files or images and then broken.