Book module in 1.6

Book module in 1.6

by Petr Skoda -
Number of replies: 42
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
I have commited several small fixes into 1.5 compatible version, you can find more info in the readme.txt file.

Current code is not fully compatible with 1.6 codebase, I will update it next week and store it in contrib/book_16 directory.

skodak
Average of ratings: -
In reply to Petr Skoda

Re: Book module in 1.6

by Art Lader -
Thank you, Petr!

-- Art
In reply to Art Lader

Re: Book module in 1.6

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
You can download the latest alpha for 1.6dev from: http://download.moodle.org/download.php/modules/book_16.zip

Installation:
  1. do a full db backup, moddata backup and dirroot backup
  2. upgrade db to 4.1.x
  3. upgrade moodle to 1.6dev
  4. delete old mod/book/*.*
  5. extract downloaded zip from above into your mod/
  6. rename book_16 to book
  7. convert site to unicode - expect problems with not iso-8859-1 encodings sad
If your site is using single non iso-8859-2 encoding, ask some database guru to do a conversion of db backup to utf-8 and then reupload into db. After that set $CFG->unicodedb=true; in your config.php.

skodak


In reply to Petr Skoda

Re: Book module in 1.6

by Vu Hung -
Hi Skodak,

Thanks for your update. It worked for me.

I wish module Book will be able to import and export data in a near future. If there is a combination between module Book and module SCORM, it will be wonderful.
In reply to Petr Skoda

Re: Book module in 1.6

by Gudjon Jonsson -

Hi I am having problem with the lang.

I have installed 1,6 Moodle,
but when I install BOOK (book_16), can not for the world of me get the lang files to play ball, they just refuse to show up in admin (book.php).

Using php 5 and Mysql 5. (database is utf8)

Anyone have any IDEA?

In reply to Gudjon Jonsson

Re: Book module in 1.6

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Works fine for me, did you rename book_16 directory to book?



I will fix some minor bugs and small feature requests right after the 1.6 release, please let me know if there are any more unreported problems or annoyances wink

thanks

skodak
In reply to Petr Skoda

Re: Book module in 1.6

by N Hansen -
I haven't been able to upgrade to the latest 1.5 version because I am still running 1.5 Moodle, but there is one thing that it would be nice if you could fix it if it hasn't been already but that is to add the ability to hide a chapter when it is first created rather than have to create it and then click on the eye afterwards to hide it.
In reply to Petr Skoda

Re: Book module in 1.6

by Gudjon Jonsson -
Yes I did rename it to book.
In reply to Gudjon Jonsson

Re: Book module in 1.6

by Gudjon Jonsson -

Sorry mates

I'm feeling kind of stupit right now.blush

You say it works fine for you, so I think what's the diffrence?
Well it's kind of obvious "the Language".....
So I think I should take look at lang.php and there it is en_utf8 is hardcoded there I think for comparing to others.
So I think, Oh I have to put book.php in en_utf8 also.
To check this I just loaded book.php manually in adminlang, and there it is "error cant find c:\...../lang/en_utf8/book.php".

So this has nothing to do with the wonderful Book mod.
Thought you should know.

Sometimes better to try to use the small peanut op there before asking stupid questions.

Thanks for the replies.

In reply to Gudjon Jonsson

Re: Book module in 1.6

by Ger Tielemans -
Installing a fresh copy of Book on a copy of Moodle16 (23 may 2006) I get this during install. The error in the mdl_log_display table is caused by a change in this table structure? - It was working fine in a early version of moodle 1.6.

Is this table used for building the log-files or so? Has everyone to change this in his own additional modules?

book


(mysql): CREATE TABLE mdl_book ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, course INT(10) UNSIGNED NOT NULL DEFAULT '0', name VARCHAR(255) NOT NULL DEFAULT '', summary TEXT NOT NULL DEFAULT '', numbering TINYINT(4) UNSIGNED NOT NULL DEFAULT '0', disableprinting TINYINT(2) UNSIGNED NOT NULL DEFAULT '0', customtitles TINYINT(2) UNSIGNED NOT NULL DEFAULT '0', timecreated INT(10) UNSIGNED NOT NULL DEFAULT '0', timemodified INT(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (id)) COMMENT='Defines book'
Success


(mysql): CREATE TABLE mdl_book_chapters ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, bookid INT(10) UNSIGNED NOT NULL DEFAULT '0', pagenum INT(10) UNSIGNED NOT NULL DEFAULT '0', subchapter TINYINT(2) UNSIGNED NOT NULL DEFAULT '0', title VARCHAR(255) NOT NULL DEFAULT '', content LONGTEXT NOT NULL DEFAULT '', hidden TINYINT(2) UNSIGNED NOT NULL DEFAULT '0', timecreated INT(10) UNSIGNED NOT NULL DEFAULT '0', timemodified INT(10) UNSIGNED NOT NULL DEFAULT '0', importsrc VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (id)) COMMENT='Defines book_chapters'
Success


(mysql): INSERT INTO mdl_log_display VALUES ('book', 'update', 'book', 'name')
1136: Column count doesn't match value count at row 1
         



Error


(mysql): INSERT INTO mdl_log_display VALUES ('book', 'view', 'book', 'name')
1136: Column count doesn't match value count at row 1
         



Error


(mysql): INSERT INTO mdl_log_display VALUES ('book', 'view all', 'book', 'name')
1136: Column count doesn't match value count at row 1
         



Error


(mysql): INSERT INTO mdl_log_display VALUES ('book', 'print', 'book', 'name')
1136: Column count doesn't match value count at row 1
         



Error


book tables could NOT be set up successfully!

(mysql): SELECT * FROM mdl_user WHERE id = '2' AND username = 'guest' LIMIT 1
In reply to Ger Tielemans

Re: Book module in 1.6

by Ger Tielemans -

Changing (in bold) the last lines in the MySQL script seems to solve the problem:

INSERT INTO prefix_log_display (module, action, mtable, field)  VALUES ('bookmark', 'add', 'bookmark', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field)  VALUES ('bookmark', 'update', 'bookmark', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field)  VALUES ('bookmark', 'view', 'bookmark', 'name');


By the way, the install procedure does not install the languages files for the module book, is that correct?

In reply to Ger Tielemans

Re: Book module in 1.6

by N Hansen -
Non-standard module language files always have to manually be put in their proper place.
In reply to Ger Tielemans

Re: Book module in 1.6

by Gudjon Jonsson -

If you are using 1,6 you have to use book_16.zip otherwise it wont work.
So if you had tried the otherone you have to clean the tables form the database.

In reply to Ger Tielemans

Re: Book module in 1.6

by Martín Langhoff -
In reply to Martín Langhoff

Re: Book module in 1.6

by Felix Zimmerbeutel -
Hi!

I am tried to install Book_16 today and everything seemed fine.
But when I try to add the activity it is listed as modulename instead of book_16 in the pulldown menu and i get the reply "This module type doesn't exist".

Where is the problem ?

Yours Felix

P.S. In the admin module interface it is referenced as book_16 but when entering the settings the heading is also moduklename
In reply to Felix Zimmerbeutel

Re: Book module in 1.6

by N Hansen -
Felix-Perhaps you didn't put the book language files where they belong.
In reply to Felix Zimmerbeutel

Re: Book module in 1.6

by Clarence Prudhoe -

Hi Felix,

After you unzip book_16 in /mod/ you have to rename the folder "book_16" to just "book".

If you have already tried to run moodle/admin, then you have to go to the Administration Panel and click configuration/modules/ and find book_16 and delete it.  Then you have to use "phpMyAdmin" to drop the book tables from the database.

Then run /moodle/admin/ again to rebuild the database and install "book".

That should fix it.

Clarence

In reply to Martín Langhoff

Re: Book module in 1.6

by Jean-Pierre Pawlak -
Martin, it would be nice if somewone committed these changes (mysql.sql) to the files in the download area.
In reply to Martín Langhoff

Ang: Re: Book module in 1.6 2 - obsolete!!

by Jens Gammelgaard -
Picture of Translators
Hi,

That Catalyst patch seems to be obsolete, please look at this bugreport:

http://tracker.moodle.org/browse/MDL-6640

Please, let us try to help each other making the book module up to date smile

In reply to Jens Gammelgaard

Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Stephen Bourget -
Picture of Core developers Picture of Plugin developers Picture of Testers
It sounds like you are working with an older copy of the book module. 

Try this one:  http://download.moodle.org/modules/book_16.zip

You will most likely need to drop any tables for the older version of the book module from your database

-Steve
In reply to Stephen Bourget

Ang: Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Jens Gammelgaard -
Picture of Translators
Hi Steve,

My test is with a fresh Moodle installation, so it is strange that I am getting error messages like if the old version is installed.

My test was also with the package from:

http://download.moodle.org/modules/book_16.zip

It seems like the sql-file in that package is obsolete too.

Any one else? smile


In reply to Jens Gammelgaard

Re: Ang: Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Jean-Pierre Pawlak -
Like Stephen Bourget says: if you try to do a install after the first install failled you will have to drop the tables (mdl_book and mdl_book_chapters) using phpMyAdmin.
In reply to Jean-Pierre Pawlak

Ang: Re: Ang: Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Jens Gammelgaard -
Picture of Translators
Hi Jean-Pierre,

That is true, and I use total fresh databases (I make a new one each time) for each try out, I clean the moodledata for any left overs. So it is odd.
In reply to Jens Gammelgaard

Re: Ang: Re: Ang: Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Stephen Bourget -
Picture of Core developers Picture of Plugin developers Picture of Testers
When you installed the book module on your 1.6.2 install did you re-name the directory to book is it named book_16?

-Steve
In reply to Stephen Bourget

Ang: Re: Ang: Re: Ang: Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Jens Gammelgaard -
Picture of Translators
Hi Steve,

Yes, I renamed it to: book.

- Jens
In reply to Jens Gammelgaard

Ang: Re: Ang: Re: Ang: Re: Ang: Re: Book module in 1.6 2 - Up to date :-)

by Jens Gammelgaard -
Picture of Translators
Hi,

I have downloaded the 1.62+ again today and downloaded the Bookmodule.

Installed the 2 scripts with the same procedure as allways - but:

Now it works. - What ever the reason is: Thank you!!
In reply to Jens Gammelgaard

Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Art Lader -
That is odd, Jens. We are running 162 and book seems to be working fine.

Weird...

-- Art
In reply to Art Lader

Ang: Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Jens Gammelgaard -
Picture of Translators
True, Book is an odd Art of Moodle maintenance smiler

I can only say I have installed 3 fresh Moodles with the latest book_16 code and with Langhoffs' patch. All failed - and I had no such failures with previous versions.

So coders,- could you try out the latest 1.62+?

It could improve Moodles image if the Q&A included the well known modules like the book.

Art,- does your installation run with MySql 4 or version 5? Mine runs version 5.

BR
Jens
In reply to Jens Gammelgaard

Re: Ang: Re: Ang: Re: Book module in 1.6 2 - obsolete!!

by Art Lader -
> Art,- does your installation run with MySql 4 or version 5? Mine runs version 5.

MySQL - 4.1.21-standard

Maybe that's the issue.

-- Art
In reply to Ger Tielemans

Re: Book module in 1.6

by Mon B -

Hello,

I'm getting the following:

 

(mysql): INSERT INTO mdl_log_display (module, action, mtable, field) VALUES ('bookmark', 'add', 'bookmark', 'name')  


1062: Duplicate entry 'bookmark-add' for key 2

         
      
   


Error


(mysql): INSERT INTO mdl_log_display (module, action, mtable, field) VALUES ('bookmark', 'update', 'bookmark', 'name')  
1062: Duplicate entry 'bookmark-update' for key 2
         
      
   


Error


(mysql): INSERT INTO mdl_log_display (module, action, mtable, field) VALUES ('bookmark', 'view', 'bookmark', 'name')  
1062: Duplicate entry 'bookmark-view' for key 2
         
      
   


Error


(mysql): INSERT INTO mdl_log_display (module, action, mtable, field) VALUES ('book', 'print', 'book', 'name')  
1062: Duplicate entry 'book-print' for key 2
         
      
   


Error

book tables could NOT be set up successfully!

 

----

also, in one of my courses, Recent Activities block Course Updates, I just noticed this:

Warning: print_recent_activity(/home/mysite/public_html/moodle/mod/book_16/lib.php): failed to open stream: No such file or directory in /home/mysite/public_html/moodle/course/lib.php on line 599

Warning: print_recent_activity(): Failed opening '/home/mysite/public_html/moodle/mod/book_16/lib.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/moodle/course/lib.php on line 599

I did rename Book_16 to Book.

I tried the mysql that came with the zip as well as with the modifications by Ger. I get similar 'duplicate entry for x key' error messages.

I reinstalled 3 times, each time deleting the tables that were created,, but I don't know enough about this backend stuff to know what the duplicate keys means.

thanks smile

In reply to Mon B

Re: Book module in 1.6

by Mon B -
Anyone? smile
In reply to Mon B

Re: Book module in 1.6

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi,

As suggested in a separate discussion, please try deleting the Book module from the page Administration >> Configuration >> Modules.
In reply to Mon B

Re: Book module in 1.6

by kevin metcalf -
Simply deleteing via the modules I/F and removing the tables does NOT solve this problem. At least, it didn't for me. I had the same error message about "(mysql): INSERT INTO mdl_log_display (module, action, mtable, field) VALUES ('bookmark', 'update', 'bookmark', 'name') " that the above user had. The system is trying to add records to the mdl_log_display table that are already there. You need to remove them manually. Login to mysql and run the following to delete the tables and remove the offending keys;
drop table mdl_book;
drop table mdl_book_chapters;
delete from mdl_log_display where module = 'book';

That should remove two tables and 4 entries from the mdl_log_display fields.


If you are using php_my_admin, login normally and look for "book" in the field "module" of table "mdl_log_display." Delete the 4 records the system finds.

HIH,
Kevin Metcalf
In reply to kevin metcalf

Re: Book module in 1.6

by Libor Práger -
Thank you, Kevin.
After having read all the suggestions and trying them unsuccessfully, the " delete from mdl_log_display where module = 'book' " has done the trick.
And the book module is worth the pains. smile
Libor
In reply to Libor Práger

Re: Book module in 1.6

by Karen Nicholas -

Thankyou Kevin for your instructions on deleting the tables. Even as a novice user I could understand and follow them.

My prob was I installed at book_16, realised the error and renamed the file to book, but hadn't deleted the tables. Just renaming the folder didn't work after the install was already done!

In reply to kevin metcalf

Re: Book module in 1.6

by Eduardo Aspe -
thank you so much, this info really helped me. (save me?? heheh) wished the install readme had this info.
In reply to Petr Skoda

Re: Book module in 1.6

by Felix Zimmerbeutel -
Hi,

would it be possible to link the book_16 on the Moodle » Download » Activity Modules page? It is only linked for moodle 1.4.3

Yours Felix
In reply to Felix Zimmerbeutel

Re: Book module in 1.6

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Felix,

Please note that the Book module for 1.6 is now available in Modules and Plugins. As far as I know, the modules download page is due to be removed very soon.
In reply to Helen Foster

Re: Book module in 1.6

by Ger Tielemans -

Helen, what is the place for the most recent versions? I thought it was CVS or does that service stop now we have this?

.. I did a fresh CVS last night but saw that the version of book was much older.. (Or must I specify more then just /contrib for a cvs?)

In reply to Ger Tielemans

Re: Book module in 1.6

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Ger,

Most items in Modules and plugins are packages updated each night from CVS, so it shouldn't make any difference whether you use CVS or the Modules and plugins database.

Please note that there are now two versions of the Book module, book.zip and book_16.zip.
In reply to Petr Skoda

Re: Book module in 1.6

by Olivier CATTEAU -

Hi all,
I've just installed the book_16 module.
I wanted to migrate the database (http://myserver/moodle/admin/utfdbmigrate.php), but I've got this message:

unicode db migration has already been performed!

At his time all tables are utf8_general_ci coded, except for mdl_book and mdl_book_chapters that are still latin1_swedish_ci.

Thanks in advance for your help.