Error when adding a label to topic section on front page.

Error when adding a label to topic section on front page.

by Dustin Elliott -
Number of replies: 7
Hello,

I have a problem when I try to add a label to the topic section of the front page.

Right now I have an image in the topic section and everything works fine but if I add a label to the topic section nothing on the page below the label or any of the blocks on the right of the page, including the "Turn editing on" button, will load.

If I make the label hidden or delete it the page loads fine.

I have tried it with just text in the label and an image but can't seem to get it to work.

It's like the page stops loading as soon as it reach the point where it loads the label.

Any ideas?

I can upload screen shots if that would help.

Thanks,
Dustin Elliott
Average of ratings: -
In reply to Dustin Elliott

Re: Error when adding a label to topic section on front page.

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Screenshots would help as that does sound odd behaviour. Sometimes if you add script/code to labels they mess up the rest of the page but adding a simple image and text should work without any problems
In reply to Mary Cooch

Re: Error when adding a label to topic section on front page.

by Dustin Elliott -
Mary,

Here are the screen shots, I am using the custom_corners theme.

This first one shows the middle section of the page and the right blocks, I have an image in the body of the topic section.

1

This next image show the label I add, when I first add it everything looks fine.

topicsectionlabeltext.bmp

If I turn the editing off or login as a different user or student this is what happens. As you can see it stopped loading the page as soon as it got to the label.

topicsectionlabel.png

Hopefully that helps you figure out what the problem is.

Thanks!
Dustin
In reply to Dustin Elliott

Re: Error when adding a label to topic section on front page.

by Dustin Elliott -
Hello,

I'm still looking for an answer to this problem.

Thanks!
Dustin
In reply to Dustin Elliott

Re: Error when adding a label to topic section on front page.

by Glenys Hanson -
Hi Dustin,

Can we eliminate at least one possible cause?

Have you tried with the standard theme? If it works normally with that then you'll know that it's the theme custom_corners causing the problem. I've had problems with custom-corners in the past (Hot Potatoes exercises don't show correctly).

If it also doesn't work in the standard theme, then we'll look for something else.

Cheers,
Glenys
In reply to Glenys Hanson

Re: Error when adding a label to topic section on front page.

by Dustin Elliott -
Glenys,

Thanks for the suggestion, I just switched to the Standard theme and got the same result.

What next?

Thanks!
Dustin
In reply to Dustin Elliott

Re: Error when adding a label to topic section on front page.

by Dustin Elliott -
Maybe this helps figure it out.

I turned on debug messages and where the label should be it says this:

Fatal error: Call to undefined function iscomplete() in E:\FFSMoodle\course\lib.php on line 1369

Here is the code from the lib.php file, looks like the problem is related to Activity Locking.

//AL CODE BEGIN
// Activity Locking -- show tracking icons
$tracks = iscomplete($mod);
if (!isguestuser()) {
if ($tracks and $mod->modname != "label") {
foreach ($tracks as $track => $state) {
if ($state == "open") {
echo "<img src=\"$CFG->pixpath/t/open.gif\" alt=\"".
get_string("activitycomplete", "lock")."\" title=\"".
get_string("activitycomplete", "lock")."\">&nbsp;";
} else {
echo "<img src=\"$CFG->pixpath/t/closed.gif\" alt=\"".
get_string("activitynotcomplete", "lock")."\" title=\"".
get_string("activitynotcomplete", "lock")."\">&nbsp;";
}
}
} else print_spacer(12, 15, false, false);
}
//AL CODE END
In reply to Dustin Elliott

Re: Error when adding a label to topic section on front page.

by Dustin Elliott -
I think I fixed it, after reading Ken's post in this topic http://moodle.org/mod/forum/discuss.php?d=137354 I was inspired to have it check if the $COURSE->ID was 1. Like Ken said I only have the problem on the homepage.

I added:

if($course->id!="1") {

}

Around the AL code and the page loaded like it should.

I'm guessing this isn't the best way to solve the problem but it works.

Thanks,
Dustin