A bug in activity modules solved ¿really?

A bug in activity modules solved ¿really?

by Jaime Alamo -
Number of replies: 5
I've found and solved a very simple bug in block version 2004052700, in the file:

blocks\activity_modules\block_activity_modules.php(line 29):

I´ve deleted the "..\" in front of "mod/...." to avoid the error 404 file not found for every module listed in the activities. So instead of :

$this->content->items[] = '<a href="../mod/'.$modname.'/index.php?id='.$this->course->id.'">'.$modnamesplural[$modname].'</a>';

Now I have:

$this->content->items[] = '<a href="mod/'.$modname.'/index.php?id='.$this->course->id.'">'.$modnamesplural[$modname].'</a>';

and it works perfectly
=========================
Is that all? or have I to change something more?

Average of ratings: -
In reply to Jaime Alamo

Re: A bug in activity modules solved ¿really?

by Jaime Alamo -
This is a bug in version 1.4dev

The problem is that showing the block "Activities" in the forepage the modules still think they are inside a course. And so the "../" in the block_activity_modules.php(line 29) serves to get off from the course, but when calling a module from the forepage jumps outside the "moodle directory" yielding a "404 - file not found".

At the other hand, the solution is not to delete the "../" because in such a case, activities in a course do not get out of the course folder and dont get into the mod folder.


Other problem showing the blocks in the forepage is that People (participants,edit profile), allows the oportunity to unenroll "from this course" even not have entered in any course yet.


In reply to Jaime Alamo

Re: A bug in activity modules solved ¿really?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks! Yes, the links are wrong when Moodle is in a subdirectory. I've fixed this in CVS by using $CFG->wwwroot ...

As for the "unenrol" ... I can't see it on my sites. It shouldn't be showing at the site level for anyone ... where exactly do you see it?

(P.S.  The best place for obvious bugs like this is the bug tracker.  Thanks.)
In reply to Martin Dougiamas

Re: A bug in activity modules solved ¿really?

by Jaime Alamo -
Thanks  Martin,

about the 'unenrol' ... it is not really a bug but the use of "course" instead of "site" or something similar.

When the admin opens the "participants" list  and press the "unenrol" for someone gets a window for confirmation:

Are you sure you want to unenrol "John Smith" from this course?

John Smith could be enrolled in three courses,  or in no course at all (just a
Potential student).  So,  I think "this course" should be "this site"

--------------------
P.S.   Excuse me,  I couldn't manage to find / use the bug tracker
In reply to Jaime Alamo

Re: A bug in activity modules solved ¿really?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I see what you mean now, it wasn't visible to me because I had more than 20 users ... I've removed the unenrol link entirely now from the list of site users ... it doesn't make sense.