Backup Problem with DFWIKI

Backup Problem with DFWIKI

by Marc BUFFAT -
Number of replies: 14
I have used dfwiki in my course using moodle 5.2 and the last version of dfwiki.
It works great, but I have a problem with the backup (or XML export)
I got the error message "Course Module ID was incorrect"  just after selecting the WIKI page to export (with export to XML). If I export only the data it works.
I have try to trace the error. It appears in the file   exportxml.php
and if I try to print  some more info with the modified php code
 
 optional_variable($id);    // Course Module ID
 optional_variable($path);
 optional_variable($file);
 optional_variable($type);

 if (! $cm = get_record("course_modules", "id", $id)) {
        error("Course Module ID was incorrect ($id,$path,$file,$type)");
                                                                 // ^^^^^^^^^^^^^^ print info
    }
I got the error message "Course Module ID was incorrect (,0,0,0)"
i.e. the variable $id is undifined, and the other variables are egal to 0

As I don't know the architecture of moodle, and how the variables are defined, I cannot go further. I have  checked the dfwiki  database, and the course id in the mdl_dfwiki is correct!
Have you any idea about this problem (that other people have also reported)

Nevertheless, thanks to all the developers of moodle
regards,  
Marc


Average of ratings: -
In reply to Marc BUFFAT

Re: Backup Problem with DFWIKI

by Ludo (Marc Alier) -
Hi Marc,
these las weeks I've been releasing so many versions of dfwiki ( preciselly
beacuse some xml export bugs ) that it would be wise to check out the exact version of dfwiki. This bug you comment sounds very similar to a bug we fixed two weeks ago.
Recurs dfwiki_1.0_rev2005111501.zip This is the last version of dfwiki.
Please tell me if this works for you or the bug stands.
Regards
Marc
In reply to Ludo (Marc Alier)

Re: Backup Problem with DFWIKI

by Marc BUFFAT -
Hi Ludo,
I am using the last version of dfwiki dfwiki_1.0_rev2005111501.zip, and the problem stands since the first version I am using dfwiki_1.0_rev2005102101.zip
Regards
    Marc
In reply to Marc BUFFAT

Re: Backup Problem with DFWIKI

by Juan Castaño -
Hi Marc,
I'm one of the developers of dfwiki. I don't understand exactly what you refer when you say that it works when you export only the data. Could you explain me exactly the way you do until you get this error, and the way you do until you make it work?
Refering to the variable id, it refers to the field id in the mdl_course_modules. Don't worry about the other 3 parameters because they are only used in other cases, but not here.
Reply as soon as possible in order to try to repare the possible bug.
Regards:
Juan
In reply to Juan Castaño

Re: Backup Problem with DFWIKI

by Marc BUFFAT -
Hi juan,
l have a dfwiki in one of my course.
In the administration tools of the dfwiki, I select
export to XML
If I don't select any pages (i.e. the default) and click on
export all
then I create successfullly a backup of all the data of the dfwiki (i.e. the images, pdf files ...)
If I redo the export to XML
export to XML
but try to select one of the WIKI pages, then when I click on the arrow to select the page I got the error
Course Module ID was incorrect
Hope it helps
and thanks again for developing dfwiki
Marc


In reply to Marc BUFFAT

Re: Backup Problem with DFWIKI

by Juan Castaño -
Hi again Marc, we are working right now in this bug.
This bug happens whatever the arrow you click and whatever the dfwiki you are working in?
Do you know the version of your php and your mysql?

Juan

In reply to Juan Castaño

Re: Backup Problem with DFWIKI

by Marc BUFFAT -
HI juan
I am running moodle on a linux box (dual PIII) running Fedora core 3
with php version 4.3.11 and mysql 3.23.58
The bug happens whatever the page I select, and whater arrow (-> or >>)
and with the 2 dfwiki I have on the site.
I also try to create a new dfwiki with only one page, and the bug happens
Hope it will help you
regards,
Marc

In reply to Marc BUFFAT

Re: Backup Problem with DFWIKI

by Ludo (Marc Alier) -
Hi Marc,
the dfwikis are placed on the main course or in a standard course.
This bug is very weird because we still haven't been able to reproduce it
on solaris, nor linux nor windows...
Can you try to create a new course with dfwikis to see if it works or the bug stands? We'll try to build a testing envirosnment with your configuration.
Regards
Ludo

In reply to Ludo (Marc Alier)

Re: Backup Problem with DFWIKI

by Juan Castaño -
Hi Marc, I haven't been able to reproduce the bug but I've found out what is happening to you.
The error is in the file dfwiki/xml/pages.html and in the first line.
The problem is that:

<form name="pageform" id="pageform" method="post" action="exportxml.php?id=<?php echo $cm->id; ?>&amp;pageaction=exportxml">

is not able to know the variable $cm->id

Change this line for this another one:
<form name="pageform" id="pageform" method="post" action="<?php echo 'exportxml.php?id='.$cm->id.'&amp;pageaction=exportxml'?>">

Please answer as soon as possible and say if it works.
Regards



In reply to Juan Castaño

Re: Backup Problem with DFWIKI

by Marc BUFFAT -
Hello Juan,
I have made the change that you suggest in pages.html
<form name="pageform" id="pageform" method="post" action="<?php echo 'exportxml.php?id='.$cm->id.'&amp;pageaction=exportxml'?>">
Now when I "export to xml" a dfwiki, I got all the pages of all the dfwiki in moodle
(and not only the pages of the selected dfwiki )
Bit when I select one page, I got the same error
Invalid course Id
as before.
You can check in my moodle site: www.ufrmeca.univ-lyon1.fr/moodle
as I have explained to ludo.
regards,
Marc
In reply to Marc BUFFAT

Re: Backup Problem with DFWIKI

by Juan Castaño -
Hello,
you get all the pages because we have entered in the account you created for ludo and have imported a dfwiki you had, and now the dfwiki you are exported have all that pages, so don't worry about that.

Please try and put this line of code at the beggining of this same file to see if $cm->id has any value or is empty:
<?php echo '---'.$cm->id.'---';?>

In reply to Juan Castaño

Re: Backup Problem with DFWIKI

by Marc BUFFAT -
Hello Juan,
I have put the code <?php echo '---'.$cm->id.'---';?>
and I got the value ---588--- on the list of pages
I have checked the mysql data base, this not a course id (which are less than ), but it correspond the  mdl_course_modules data base
id field 588
course  56
module 20

the course 56 is the course where the dfwiki is (in mdl_dfwiki) for the test course
id field 6
course 56

regards,
Marc
In reply to Marc BUFFAT

Re: Backup Problem with DFWIKI

by Juan Castaño -
Ok this values are correct.
I think I have the solution, replace the file "pages.html" for this another and tell me something please

Regards,
Juan
In reply to Juan Castaño

Re: Backup Problem with DFWIKI

by Marc BUFFAT -
Hello Juan
It works !!
thanks a lot for your development.
Now the export to HTML work with all the dfwiki, and the problem is now solved
regards,
    Marc
In reply to Marc BUFFAT

Re: Backup Problem with DFWIKI

by Ludo (Marc Alier) -
Great aprobación!!!
Juan, send me the new code so I can squeeze it into the next dfwiki release!
Regards
Marc