General help

Fatal error on lesson display

 
 
Picture of oliver lyons
Fatal error on lesson display
 

 Dear forum

am using Moodle 2.2+ (Build: 20111209).  

When I click on any lesson link I get this error:  Notice: Undefined index: 20 in /home/learneng/public_html/moodle/mod/lesson/locallib.php on line 2685
Fatal error: Call to undefined method lesson_page_type_manager::callback_on_view() in/home/learneng/public_html/moodle/mod/lesson/view.php 

no lessons display. Can anyone help mot recover the lessons ?  Any help would be much appreciated. 

 
Average of ratings: -
Picture of Ken Task
Re: Fatal error on lesson display
Group Particularly helpful Moodlers

Sorry, not seen such before, so following is 'exploration' ...

Suggest turning on debugging first and attempt to access a Lesson again (or is this the output of that below?)

Notice: Undefined index: 20 in /home/learneng/public_html/moodle/mod/lesson/locallib.php on line 2685

The function that contains line 2685 of a 2.2.x:

* This function loads ALL pages that belong to the lesson.

The specific line:
public function load_all_pages(lesson $lesson)

From the error Undefined Index … could be the mdl_lesson table is in need of repair - an index needs to be rebuilt for it.

What do you get with:
select * from `mdl_lesson`
using any DB tool to which you have access.

'spirit of sharing', Ken

 
Average of ratings:Useful (1)
Picture of oliver lyons
Re: Fatal error on lesson display
 

Thanks Ken. Will chceck this out later and see what I get.

 

Oliver

 
Average of ratings: -
Picture of oliver lyons
Re: Fatal error on lesson display
 

Hi Ken

I've run the query and everything looks fine  I also checked on mdl_lesson_pages and that seems fine too.

 

On other thing -- I tried to run  a backup and got this :

Warning: require_once(/home/learneng/public_html/moodle/backup/util/factories/backup_factory.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/learneng/public_html/moodle/backup/util/includes/backup_includes.php on line 38

Fatal error: require_once() [function.require]: Failed opening required '/home/learneng/public_html/moodle/backup/util/factories/backup_factory.class.php' (include_path='/home/learneng/public_html/moodle/lib/zend:/home/learneng/public_html/moodle/lib/pear:.:/usr/lib/php:/usr/local/lib/php') in /home/learneng/public_html/moodle/backup/util/includes/backup_includes.php on line 38

 

not sure if it's related.

Thanks for your attention

 

Oliver

 
Average of ratings: -
Picture of Ken Task
Re: Fatal error on lesson display
Group Particularly helpful Moodlers

Just thought of something that might work ... can you create a new lesson?  Doesn't need to be complete ... just something basic/simple.  Sometimes, creating something new triggers other things related to the mod ... like re-indexing.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of oliver lyons
Re: Fatal error on lesson display
 

Hi Ken

Thanks so much for your advice. When I set up a new lesson and add a question page I get this on top of the page :

Notice: Use of undefined constant LESSON_PAGE_MULTICHOICE - assumed 'LESSON_PAGE_MULTICHOICE' in /home/learneng/public_html/moodle/mod/lesson/editpage_form.php on line 52

There's an empty dropdown box where the question options should be so I can't add a question page.

 

Thanks again

 

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Fatal error on lesson display
Group DevelopersGroup TestersGroup Translators

The constant LESSON_PAGE_MULTICHOICE is defined in moodle\mod\lesson\pagetypes\multichoice.php

Can you check that you have all the necessary Lesson files on your Moodle site, including that particular file, and that none of your files are corrupted?

Joseph

 
Average of ratings:Useful (1)
Picture of oliver lyons
Re: Fatal error on lesson display
 

Hi Joseph

Thanks for your insight -- pagetypes is  empty . I'm going to copy over the needed files from the installation files and see what happens. This might explain the issue I've been having.

 

Thanks

 

Oliver

 

 
Average of ratings: -
Picture of oliver lyons
Re: Fatal error on lesson display
 

Dear Joseph

Success !

All lessons are restored. Thanks so much -- really appreciated.

I also copied over util files and that's fixed the backup issue.

I've learned a lot.

 

Thanks

 
Average of ratings: -
Picture of Ken Task
Re: Fatal error on lesson display
Group Particularly helpful Moodlers

Let's back track here a little ... operating system is linux, but which distro?  Assuming remotely hosted ... what provider?  Other info: PHP version.  *How was it installed?*  manually or some button installer from hosting provider?

+1 to what Joseph asked!!!

'spirit of sharing', Ken

 
Average of ratings: -
Picture of oliver lyons
Re: Fatal error on lesson display
 

Dear Ken

All Ok now.  Thanks for your attention and help.

 

Regards

 

oliver

 
Average of ratings: -
Picture of Ken Task
Re: Fatal error on lesson display
Group Particularly helpful Moodlers

Glad it's resolved ...  Suggest you rate Joseph's post as 'useful'. 

And have yet another suggestion for you ... if those files were missing, what other files might be missing?  If one runs into other issues, that would be the first thing to check - are the files there?  For pondering ... why weren't the files there?  Were they there before?

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Derist Touriano
Re: Fatal error on lesson display
 

Hi,.... Im using Mod 2.4.1 i didnt know when i editing course topic the page show warning like this :

Warning: realpath(): open_basedir restriction in effect. File(/home/touriano/moodledata) is not within the allowed path(s): (/home/touriano/public_html:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/touriano/public_html/learn/lib/setup.php on line 69

Warning: Cannot modify header information - headers already sent by (output started at /home/touriano/public_html/learn/lib/setup.php:69) in /home/touriano/public_html/learn/lib/setup.php on line 72
Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Fatal error on lesson display
Group DevelopersGroup TestersGroup Translators

@Derist: You seem to have a real problem on your moodle server.

See this discussion: https://moodle.org/mod/forum/discuss.php?d=198116

Joseph

 
Average of ratings: -