Опубликовано Joseph Rézeau

Moodle in English -> Installing and upgrading help -> CVS not responding?

от Joseph Rézeau -
Изображение пользователя Core developers Изображение пользователя Plugin developers Изображение пользователя Testers Изображение пользователя Translators
Hi!

Is there currently a problem with the CVS server or am I doing something wrong?
Last night and this morning when I tried to update my current test version of Moodle 1.5DEV I got the folling error message:

In C:\Moodle4Windows\htdocs\moodle15\moodle: C:\Program Files\TortoiseCVS\cvs.exe -q update -d -P
CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/moodle

cvs [update aborted]: unrecognized auth response from cvs.sourceforge.net: M PserverBackend::PserverBackend() Connect (Connection refused)

Error, CVS operation failed

thanks

Joseph_R

Изображение пользователя Core developers Изображение пользователя Plugin developers Изображение пользователя Testers Изображение пользователя Translators
Hi Tony & David.

1- The workaround for customizing CSS for one course only does cause a problem when it points to a non-existent style sheet in a course's root directory. Curiously the problem seems to appear only when someone logs in as guest. Then, on the very first display of a course without its own stylesheet, the URL shows up as, e.g. http://yoursite/moodle/file.php/8/styles.css
& the following message is displayed:
Sorry, the requested file could not be found
Continue

2- So I tried to apply David's solution (22 September 2004).
However, I had to solve two problems.
a) there is a little syntax error
instead of :
if (file_exists($CFG->dataroot/$current_course_id/styles.css))
we should have:
if (file_exists("$CFG->dataroot/$current_course_id/styles.css
"))
(commas missing)
b)  // print the extra css line should read:
print('<link rel="stylesheet" type="text/css" href="'."$CFG->wwwroot/file.php/$course->id/styles.css".'">');
(all on one line)

3- To recap, to make sure that David's genial workaround works  in all cases (i.e. for courses which have their own CSS stylesheet & for those who don't, without displaying any error message):

1. Ask our Moodle admin (or webmaster or root) to edit file header.html in current theme subdirectory
2. Find the lines (around line-number 6-7)
   <meta name="keywords" content="moodle, <?php echo $title ?> " />
   <link rel="stylesheet" type="text/css" href="<?php echo $styles >" />

3. After these lines, add the following:
<?php
    $current_course_id = $course->id ? $course->id : 1;
// if course id is not set use 1 instead
// (it means site home page)
    if (file_exists("$CFG->dataroot/$current_course_id/styles.css")) {
        print('<link rel="stylesheet" type="text/css" href="'."$CFG->wwwroot/file.php/$course->id/styles.css".'">');
    }
    unset($current_course_id);
?>
Enjoy!
Joseph_R