Book import fixes

Book import fixes

by Petr Skoda -
Number of replies: 8
Immàgine de Core developers Immàgine de Documentation writers Immàgine de Particularly helpful Moodlers Immàgine de Peer reviewers Immàgine de Plugin developers
I have just commited some changes in import code that are based on patches from Jaroslav eděnka. List of changes:
  • better handling of #anchors
  • relative links to non-html files are converted to Moodle absolute links
  • backslashes in links are treated as slashes - MS compatibiltiy hack

skodak
Average of ratings: -
In reply to Petr Skoda

Re: Book import fixes

by John Isner -
Hi Petr,
I have a question about using CVS to checkout the book module.

Here is is my CVS checkout command:

$ cd /var/www/moodle
$ cvs co -r MOODLE_18_STABLE -d mod/book contrib/plugins/mod/book

This creates a lang directory under the book directory (see screenshot). The book/lang directory must be moved -- or rather merged -- with the 'real' lang directory, which is up one level. In the past, when I installed book using the zip file from modules and plugins, I made these structural changes manually. Now that I am using CVS, do I also have to merge the contents of the lang CVS subdirectories?

I guess the real question is: Why doesn't the book module have lang and mod at the same level so that CVS checkout works without requiring any subsequent restructuring by the administrator?

I'm also wondering how I should update the book module using CVS, since update will have the same structural problems as the initial checkout.

Attachment book_module_cvs_structure_vs_moodle_structure.png
In reply to John Isner

Re: Book import fixes

by John Isner -
I found the answer to my question. According to the Moodle documentation on non-standard modules,

Some of the modules may contain their own language files. If so then just leave them there, they'll be found automatically.

Book is one of the modules that 'contains its own language files' (contrib/plugins/mod/book/lang). There is no need to move this directory (or merge it with moodle/lang) because Moodle looks for a mod/book/lang directory before looking for moodle/lang/book.

The CVS checkout command for book, and later the CVS update command, are all that's needed.
In reply to John Isner

Re: Book import fixes

by Ralf Hilgenstock -
Immàgine de Core developers Immàgine de Particularly helpful Moodlers Immàgine de Translators
Hi Jon,

"there is no need to move this directory", Thats not exactly correct. Its correct if you only use the existing lang files. If you try to edit this files in the admin language menu the files in this folder are not found.

Ralf
In reply to Ralf Hilgenstock

Re: Book import fixes

by John Isner -
Ralf,
I see you already created issue MDL-9361 "Ability to edit language in third party modules and plugins w/o copying the language files". I voted for it and I also added a note to the documentation.
In reply to Petr Skoda

Book for Moodle 1.8

by Del Helms -
I recently download the books module for Moodle 1.8 and placed the books folder into the moodle/mod folder. Unfortunately, it is showing up as resource rather than an activity. It works fine, but it is a bit odd I think that it would show up in the wrong pull-down menu.

Moodle 1.8
Mac OS 10.4 client
Apache 1.3.33
PHP 5.2.2
MySQL 4.1
Safari browser

Respectfully,

Del
In reply to Del Helms

Re: Book for Moodle 1.8

by John Isner -
I always thought Book should be classified as a resource since students do not interact with them in any significant way. I wonder if this was intentional.