$course passed to moodle_page::set_course does not look like a proper course object.

$course passed to moodle_page::set_course does not look like a proper course object.

autor Sanjay Singh -
Počet odpovedí: 6
Dear all, I am in urgent need of your assistance or guidance in anyway possible. We run a Moodle site with about 12000 users and expected to grow to about 30000 by next year. We run version 2.5. Our student enrollment system is done through .NET environment. I made a sample application on Visual Basic and through web service created a course. I have developed my own web service and WSDL document. However as soon as unit was created, our Moodle site became inaccessible. All the pages would give the following error "Coding error detected, it must be fixed by a programmer. $course passed to moodle_page::set_course does not look like a proper course object". While I commented the line giving this error and failing to load page in file /lib/pagelib.php to get the site up, I am still not able to turn editing on on frontpage. Any suggestions or guidance would be highly appreciated. Thanks Sanjay
Priemer hodnotení : -
V odpovedi na Sanjay Singh

Re: $course passed to moodle_page::set_course does not look like a proper course object.

autor Sanjay Singh -

Also note that I have replaced the code with the fresh code, yet it does not work. my assumption is that something has gone wrong with the database. I have deleted the course created through Web Service in the database as well. Can anyone outline which table may have created a problem here

V odpovedi na Sanjay Singh

Re: $course passed to moodle_page::set_course does not look like a proper course object.

autor Phillip McAbee -

Can you manually clear your theme cache?

V odpovedi na Phillip McAbee

Re: $course passed to moodle_page::set_course does not look like a proper course object.

autor Sanjay Singh -

Thanks Phillip for coming to my rescue.

I have cleared theme cache as well as applied purge all caches. That didn't do much help. 

Do I need to delete some folders in filesystem when you refer to do it manually?

May I know where the folders may be residing. is it inside the moodledata folder.

Thanks

Sanjay

V odpovedi na Sanjay Singh

Re: $course passed to moodle_page::set_course does not look like a proper course object.

autor Tim Hunt -
Obrázok: Core developers Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Peer reviewers Obrázok: Plugin developers

Look in the database. Do you have a row in the mdl_couses table where id is 0? (In Moodle, an id should never be 0. It should always be a positive integer.)

If there is such a row, try deleting it, or changing 0 to an unused value. If possible, get into a state where you can delete that course through the Moodle UI.

V odpovedi na Tim Hunt

Re: $course passed to moodle_page::set_course does not look like a proper course object.

autor Gareth J Barnard -
Obrázok: Core developers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers

You could also set-up a test Moodle installation, backup the database, run the tool on that and see if the issue happens again.  If it does then you are in a position to compare the database with its backup in order to determine what changed and therefore how to fix the site.

V odpovedi na Tim Hunt

Re: $course passed to moodle_page::set_course does not look like a proper course object.

autor Sanjay Singh -
Dear Tim and Everyone else,

Thanks alot for all your input.

In my course table, the id of site changed from 1 to 0 somehow. Changing that resolved the issue.

Úsmev

Thanks again to everyone