$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.

ó $a->name - $a->date
Number of replies: 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
Meán na gcomhlán: -
In reply to Sanjay Singh

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

ó $a->name - $a->date

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

In reply to Sanjay Singh

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

ó $a->name - $a->date

Can you manually clear your theme cache?

In reply to Phillip McAbee

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

ó $a->name - $a->date

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

In reply to Sanjay Singh

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

ó $a->name - $a->date
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of 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.

In reply to Tim Hunt

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

ó $a->name - $a->date
Picture of Core developers Picture of Particularly helpful Moodlers Picture of 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.

In reply to Tim Hunt

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

ó $a->name - $a->date
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.

Aoibh

Thanks again to everyone