After several days journey into cms-system sourcecode I found some kind of solution for incompatibility between cms-system (newest ) and moodle 1.7.+
My site used cms in 1.6.2 moodle very well and we have a lot of cms pages inside it. That's why I must do patch to cms-system.
Some caution to remember: New moodle uses roles ... and my patch don't use them. Use this at your own risk !!!
a) I assume that you have upgradet cms to newest version.
Make sure that your cms datatables is in rigth format !! My tables was not
after upgrading cms under moodle 1.7+ . Use MySqlAdmin to look it.
That's very important !!! Add missing fields in right format. ( Don't !!!! if you do not know how to do it !!!! )
Dig into mdl_cmsnavi_data table and give value to pagename-field for every line in that table. Functions need those names.
Ok. Lets go forward...
b) Just like in old cms-installation insert
define('FRONTPAGECMS', 5);
at the beginning of file /course/lib.php. You see the place
c) Also in /admin/site.html insert line
FRONTPAGECMS => get_string("frontpagecms","cms"),
in right place .... you find it... just under FRONTPAGECATEGORYCOMBO
I'm not sure is previous necessary because you must dig yourself into
/lib/adminlib.php and find place
FRONTPAGECATEGORYCOMBO => get_string('frontpagecategorycombo'),
There insert under that line:
FRONTPAGECMS => get_string('frontpagecms','cms'),
in proper place.
d) And then two hacks ...
First in file /cms/pageadd.php find lines:
$page->isfp = 0;
$page->sortorder = 2000;
$page->parentid = clean_param($page->parentid, PARAM_INT);
and comment last one out and write a new one
$page->parentid = 0;
For some reason you do not get right value and that's why you can't see your new page.
Second in file /cms/pageupdate.php find lines
$page->id = clean_param($page->nid, PARAM_INT);
$page->naviid = clean_param($page->naviid, PARAM_INT);
$page->title = stripslashes(strip_tags($page->title));
if ( !empty($page->title) and preg_match("/^\S{3,}/", $page->title) ) {
$page->parentid = !empty($page->parentid) ? intval($page->parentid) : 0;
and comment last one outand write new one
$page->parentid = 0;
for same reasons.
I think that's all. Use at your own risk and upgrade when Janne makes
official version of cms-system.
..lasse..
ps. Pardon my poor English.