Forum Problems Installing LAMS: Moodle Integration Problem


 
You may request notification for Moodle Integration Problem.
Search: 

1: Moodle Integration Problem
01/02/08 11:34 PM
[ Reply | Forward ]
I have Moodle and LAMS installed on the same Linux server. I am running Moodle 1.9 beta 3 and LAMS 2.0.4

Lams is working correctly and Moodle is working correctly. I installed the LAMS 2 module in Moodle. After the tables were set up I clicked the continue button and it displayed a blank page. Every time I go back to the Moodle admin page I get a blank page. I turned on debugging and here is the message I get. It also happens when I try to edit the setting for LAMS 2. The module shows up in my list but this is what happens when I try to edit the settings.

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /var/www/html/moodle19/mod/lamstwo/lib.xml.inc.php on line 860

Notice: Constant XML_ELEMENT_NODE already defined in /var/www/html/moodle19/mod/lamstwo/lib.xml.inc.php on line 27

Notice: Constant XML_TEXT_NODE already defined in /var/www/html/moodle19/mod/lamstwo/lib.xml.inc.php on line 28

Notice: Constant XML_CDATA_SECTION_NODE already defined in /var/www/html/moodle19/mod/lamstwo/lib.xml.inc.php on line 29

Notice: Constant XML_COMMENT_NODE already defined in /var/www/html/moodle19/mod/lamstwo/lib.xml.inc.php on line 30

Notice: Constant XML_DOCUMENT_NODE already defined in /var/www/html/moodle19/mod/lamstwo/lib.xml.inc.php on line 31

Posted by Rod Spears

2: Re: Moodle Integration Problem
In response to 1 01/03/08 06:19 PM
[ Reply | Forward ]
Hi Rod,

I'm not 100% sure why your admin page is blank now. Was this happening before you install LAMS?

Now regarding the Warning and Notice statements when you turn debugging on, those are due to a PHP XML dom library that we had to use to get PHP 4 users.

The main problem we had with PHP is that it doesn't come with a DOM parser unless you are using PHP 5 _and_ you compile it with DOM (see PHPinfo()). If you have PHP 4, then you don't have many options but to use external libraries.

Since Moodle requires PHP 4.3 as its minimal requirement, we had to opt for PHP DOM XML library, which support PHP 4.10+.

However, this library is rather old, it seems to use some deprecated methods and these warnings get thrown on the screen.

If you have Moodle debugging turned on, then the LAMS2 module to add lessons will simply not work :-(

Having said that though, if debugging is set to minimal, then you shouldn't have any problems.

I believe I read that Moodle 2 will require PHP5 so hopefully we'll be able to use the default built-in DOM support rather than using external libraries.

Now, if you do use PHP5 and DOM is built into it, I think it would be pretty simple to use that rather than the phpdomxml lib.

Let me know if that's the case with your server, and then give tell you were to change the code and all... (I just need to remember how to do this) :-)

Thanks,

Ernie

Posted by Ernie Ghiglione

3: Re: Re: Moodle Integration Problem
In response to 2 01/03/08 09:38 PM
[ Reply | Forward ]
Ernie,

No, I did not have that problem before installing LAMS 2. The page is not blank all the time, just whenever I attempt to open the settings for LAMS 2.

My server runs PHP version 5.2.4
Here is the info about DOM

DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.29
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled

Thanks,

Rod

Posted by Rod Spears

4: Re: Re: Re: Moodle Integration Problem
In response to 3 01/03/08 11:50 PM
[ Reply | Forward ]
Hi Rod,

I think I know why the admin page is showing blank. It seems that now in 1.9 there's a new library that is conflicting with the lib.xml.dom library... That's the annoying part of using external libraries and not have proper namespaces for libraries. :-(

So here's a hack:

1.- Edit the moodle/mod/lamstwo/lib.php

in line 258 change this line

$domdoc = new XML();

to

$domdoc = new XML1();


Save the changes

2.- Edit the moodle/mod/lamstwo/lib.xml.inc.php

in line 654 change this line:

class XML extends XML_Document {


to

class XML1 extends XML_Document {


Also in line 657 change this line:

function XML($url = '') {

to

function XML1($url = '') {


That should be fix the admin blank page problem and if you have debugging set to minimal, LAMS should work just fine.

Let me know otherwise.

Thanks,

Ernie

Posted by Ernie Ghiglione

5: Re: Re: Re: Re: Moodle Integration Problem
In response to 4 01/04/08 01:27 PM
[ Reply | Forward ]
Thanks Ernie. We are making progress. Thank you!

I edited those files and it corrected that problem. I then setup LAMS and the settings validated correctly. I was then able to start creating a sequence. Everything looked like it was working correctly until I started the sequence. Then I got this error: Could not add a new instance of lamstwo

I logged in to LAMS and I could see the sequence that I just created in moodle when I opened the monitor. It said the sequence was started, however, when I go back to moodle there are no lamstwo sequences.

Rod

Posted by Rod Spears

6: Re: Re: Re: Re: Re: Moodle Integration Problem
In response to 5 01/04/08 05:50 PM
[ Reply | Forward ]
Rod,

I suspect the lamstwo table is missing. The sequence is started on the LAMS side, but Moodle is unable to record the details about the sequence as the table is missing.

Normally I've seen this with MySQL when the strict_trans_tables is turned on and something in the script causes the create table statement to fail. I thought we had fixed the sql - I'll have to check again!

Check your database and make sure the <mdl>_lamstwo table exists, where <mdl> is whatever your normal table prefix is. If it doesn't exist, use the script in the lamstwo package to create the table.

Glad to hear that the import is working. After I posted I wondered if it could be the browser expanding the zip file automatically.

Fiona

Posted by Fiona Malikoff

7: Re: Re: Re: Re: Re: Re: Moodle Integration Problem
In response to 6 01/04/08 10:58 PM
[ Reply | Forward ]
Thanks again Fiona. There was a lams table but no lamstwo table. I used the script to set up the table as you suggested and now it is working.

Thanks for the help!

Rod

Posted by Rod Spears

8: Re: Re: Re: Re: Re: Moodle Integration Problem
In response to 5 01/07/08 02:02 AM
[ Reply | Forward ]
Hi Rod,

I have fixed the problem with the colliding library and also all the Notices/Warnings that it used to throw. So if you download the latest LAMS-Module, it should work no problems even if you have Debugging set to ALL.

Just unzip the file and replace the lamstwo directory in your moodle/mod and it should all be fine (no database changes, so it should work straight away). As usual, do a backup before applying any changes as an extra precaution.

Thanks,

Ernie

Posted by Ernie Ghiglione

Reply to first post on this page
Back to Problems Installing LAMS