Problem with cohorts in categories

Problem with cohorts in categories

by David Hernández -
Number of replies: 4

Hi,

In a new installation (Moodle 2.0, Build: 20101125) I uploaded some testing users (Student1, Student2, etc.)

When I try to make a cohort named "Students", with ID "S-1", I get a blank page.

The Apache error logs say nothing, but the Moodle debugging systems shows the following error:

Fatal error: Call to undefined function can_edit_in_category() in F:\www\soporte\lib\navigationlib.php on line 3501

I'm using a Win-XP machine, with Apache 2.2.11, MySQL 5.1.22-community and PHP 5.2.8

I checked the databse with phpMyAdmin and the cohort is there, but it isn't visible through Moodle (you can't add users).

The cohort is also visible in the course (when you try to enrol students).

If I repeat the process choosing the system level for the cohort, everything works fine.

Does anybody have the same problem or do you think that something is wrong with my installation?

Thanks!

Average of ratings: -
In reply to David Hernández

Re: Problem with cohorts in categories

by Tobias Sanders -

Hey David,

same problem here. Seems like they fixed it tonight. Wait for 2.0.1

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

Regards

Tobias

Average of ratings: Useful (1)
In reply to Tobias Sanders

Re: Problem with cohorts in categories

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

Just to clarify, you don't need to wait until 2.0.1 is released to obtain the fix - you just need to download a 2.0+ package. If you do a CVS checkout (as explained in CVS for Administrators), you will have a 2.0+ package. Alternatively, you can wait for a 2.0+ download link to be added to http://download.moodle.org/.

In reply to Helen Foster

Re: Problem with cohorts in categories

by David Hernández -

Tobias and Helen,

Thank you for your help!

I'll try what Helen sugests (the use of CVS).

David

In reply to David Hernández

Re: Problem with cohorts in categories

by David Hernández -

Well, in this case you can also do the changes manually.

In the file:

[moodle]/lib/navigationlib.php

Go to line 3501:

if (can_edit_in_category()) {

And change it like this:

if (has_any_capability(array('moodle/category:manage', 'moodle/course:create'), $this->context)) {

With this, everything works OK (thanks to Sam Hemelryk, who did the modification).

Sources of interest:

The mentioned bug above.

Sam's GIT virtual space.

Moodle's GIT site.

Average of ratings: Useful (1)