Details
Description
Scenario:
HTML file A has a relative link to HTML file B. Both files are added to a Zip. The Zip is imported into a Book and chapters are created from the HTML files. The Book module attempts to preserve the link from A to B, using the new paths created as A and B are now chapters in the book. However, there is an error in the link created as it uses 'chapter' as a parameter instead of 'chapterid'.
Solution:
In mod/book/tool/importhtml/locallib.php
In function toolbook_importhtml_import_chapters
Line 140/141
Change
$newcontent = str_replace($match, 'href="'.new moodle_url('/mod/book/view.php',
array('id'=>$context->instanceid, 'chapter'=>$target->id)).'"', $newcontent);
to
$newcontent = str_replace($match, 'href="'.new moodle_url('/mod/book/view.php',
array('id'=>$context->instanceid, 'chapterid'=>$target->id)).'"', $newcontent);
Sorry, I'm just an occasional user so not used to creating patch files myself. Hope it helps!