Moodle upgrade - parts of site now not usable (3.1.5)

Moodle upgrade - parts of site now not usable (3.1.5)

by Mark B -
Number of replies: 10

Hi there,


I have recently upgraded my version of Moodle from 2.6.5 to 2.7 which worked fine.  After this i did another update straight away from 2.7 to 3.1.5 and now i cannot seem to access the "Site Administration" menu and keep getting the following error everywhere on the site:

Coding error detected, it must be fixed by a programmer: Function get_categories() is removed. Please use coursecat::get_children() or see phpdocs for other alternatives


After this i then noticed having put debugging mode on that the following message appears for each item on the site administration menu when debugging...seems to appear on each page with the site administration:

Duplicate admin category name: blocksettings

  • line 955 of /lib/adminlib.php: call to debugging()
  • line 59 of /admin/settings/plugins.php: call to admin_category->add()
  • line 7279 of /lib/adminlib.php: call to require()
  • line 3672 of /lib/navigationlib.php: call to admin_get_root()
  • line 3538 of /lib/navigationlib.php: call to settings_navigation->load_administration_settings()
  • line 724 of /lib/pagelib.php: call to settings_navigation->initialise()
  • line 773 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
  • line 107 of /blocks/admin_bookmarks/block_admin_bookmarks.php: call to moodle_page->__get()
  • line 288 of /blocks/moodleblock.class.php: call to block_admin_bookmarks->get_content()
  • line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 976 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 1028 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 476 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()
  • line 39 of /theme/bootstrapbase/renderers/core_renderer.php: call to core_renderer->standard_head_html()
  • line 34 of /theme/eguru/layout/columns2.php: call to theme_bootstrapbase_core_renderer->standard_head_html()
  • line 1028 of /lib/outputrenderers.php: call to include()
  • line 958 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 2812 of /lib/outputrenderers.php: call to core_renderer->header()
  • line 388 of /lib/setuplib.php: call to core_renderer->fatal_error()
  • line ? of unknownfile: call to default_exception_handler()

Does anybody know what i can do solve this?  I still have my 2.6.5 and 2.7 versions on my web server and also have a database backup from yesterday which i kept before the update from 2.7 to 3.1.5.

I have read that normally with errors like this the only thing you can do is possibly upgrade Moodle.  If i upgrade to a later version of 3.1.5 do you think that this would then solve it?  As a last resort i want to go do a backup to my previous version of Moodle as that will take forever to do re-import my SQL files on such a large website

If somebody would just advise on the best course of action here then that would be great.  As i say, Site Administration menu is no longer accessible; get_categories is showing as obsolete and also i am getting "duplicated admin category name" error.

Many thanks,

Mark

Average of ratings: -
In reply to Mark B

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I would start by redownloading the moodle code for 3.1.5 and replacing your existing code.  Add back in your plugins and config file and see if that resolves it.  It could be that something corrupted in the download.  Also, double check file ownership and permissions.  Also, clear your caches.

In reply to Emma Richardson

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Mark B -

Currently reuploading the latest release for 3.1.5 and going to try that.  I cannot clear caches as the clear caches screen will not load as none of the site administration will.  Do you think just restarting my Apache server will do the trick there?  Cannot even get it in maintenance mode through GUI and so will need to find a command line command to launch this.


I'll let you know how i get on.


Mark

In reply to Mark B

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

You can actually go into your moodleDATA folder, not code folder, and delete the cache and localcache folders but I do not actually think that is the issue here...just a maybe just in case kind of option!!

In reply to Emma Richardson

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Mark B -

Ok i reinstalled Moodle 3.1.5+ (the latest release) and i have not got any further really.  Turned out that one of my plugins which isn't really supported in 3.1 insisted on calling get_categories which i have now updated to the newer version of this function call.

The thing is, i did this on a test server and it went on straight away using the exact same setup...now all of a sudden, something just isn't right.

When i go to visit the site administration menu it just wurles around now as though it is constantly loading.  Also if i visit the admin index i get the following error message:

Fatal error: Cannot redeclare class coursecat_sortable_records in /var/www/moodle2/lib/coursecatlib.php on line 3197

The irony is that line 3197 is a blank line and is the end of the actual coursecatlib file and so not sure what it means that it is declared twice...seen anything like that before?

Again all of my courses seem to have lost their sections and only have Orphaned activities but i think this could be to do with an update of the topcoll for the sections which is now called Topics and saves as that in the database it seems but i can look more into that to narrow it down more.

If you have any ideas over anything then just let me know

In reply to Mark B

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Mark B -

Ok installing the topcoll worked to get my activities back but they are all hidden; i'm not going to go around each course unhding everything and so i'm looking for a clean script to do this.  I may just write one myself which updates course_sections by setting visible to 1.


Still no access to the site administration and so if anybody has seen common issues to clicking on it and it just whirling around then get back to me.

Mark

In reply to Mark B

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

Sorry to add to your woes, but just a thought - orphaned sections are still visible (i.e. they’re not hidden) - so changing the value for 'visible' in mdl_course_sections may not actually help (that value controls show/hide the topic).

You may need to alter the 'value' (which is number of sections in the course) in mdl_course_format_options

In reply to Mark B

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ahh, the topcoll woes of upgrading without it.  This has happened to me more than once (no, I apparently did not learn the first time!).  For some reason, if you go to a course that was set to topcoll and forgot to install topcoll in the upgrade, then all the activities fall into one section and you have to move/unhide/reset the whole course.  Very frustrating - haven't found a way around it yet sadly.  I am sure there is a script.  

When you upgraded, did you get any warnings on the environment page by the way?  Wondering if you maybe need to do the Antelope/Barracuda upgrade on database?

In reply to Emma Richardson

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Mark B -

Hi there,


Ok i installed topcoll as well as topics (which is more or less the same thing these days) and changed the version to match my version of Moodle as it kept saying a more up to date version was already installed.

I also added in the plugin name to the version.php file i.e. format_topcoll

Once i did that and updated the plugins; all of my resources seemed to come back into the right places within the courses.  This was because the database had the sections topcoll written for them in the course_sections table.  Next i written a small script to update this table and change the visible value from 0 to 1 where a name was actually given i.e. ignore any topic which had no name as it was not in use...walla, all of the activities are back to normal...a bit naughty but it worked

Now my only concern appears to be the access to site administration.  I recently updated my Moodle database to Barracuda:

Database version:      5.5.47-0ubuntu0.12.04.1
Database name:         ********
Database engine:       InnoDB
innodb_file_per_table: ON
innodb_file_format:    Barracuda


Should this be fine or you think some form of upgrade is needed? It is just weird how everything is now working apart from the site administration menu.

Just a note on that one actually.  when i visit "http://mymoodlesite.com/admin" it takes me to "http://mymoodlesite/admin/index.php?cache=1" and all i get is a white screen.  Debugging shows this as discussed earlier;

Fatal error: Cannot redeclare class coursecat_sortable_records in /var/www/moodle2/lib/coursecatlib.php on line 3197 (there being nothing declared on line 3197 as that is the end of file line)

maybe that is causing it to whirl around when clicking on the link also?  I'm not sure; what could the barracuda upgrade potentially do?


In reply to Mark B

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Mark B -

Ok; just thought that i would give some extra info here.  I realised that Moodle 3.1 asked me to place the BigBlueButton module into the /mod folder instead of the blocks folder and after doing a lot of debugging i realised that it was this mod which caused my admin menu to not work.  I didn't really need the mod anyways and so i removed it...not even sure if it was compatible with Moodle 3.  Some calls to some functions which are no longer on Moodle also have made the site inaccessible e.g. get_categories which has now been replace


Some other things i have came across are any references to 'admin' as a page layout result in the error i mentioned above:

Fatal error: Cannot re-declare class coursecat_sortable_records in /var/www/moodle2/lib/coursecatlib.php on line 3197 (there being nothing declared on line 3197 as that is the end of file line)

When i take the page layout off then them parts of the site which crashed appear to work fine (this needs to be in all PHP files which reference that which crashed before)

Some of my old plugins i still need to configure but that coursecatlib.php error is annoying me.  

The only other thing i have done is generated some MySQL scripts to convert some tables to barracuda which were not converted...it was only about 5 or so of them and this doesn't seemed to have had any affect on anything.

Also when i said my files all came back?  Turns out that the shortcut i took is very hit and miss; some resources are still showing under topic 1 of the unit instead of under the topic i want them to be displayed under...and are indeed hidden.  It is only about 50 units affected and so i am just transferring them manually as i notice them...bizarre behaviour.  I will report back if i get any further but it's the coursecatlib errors which are now annoying me

In reply to Mark B

Re: Moodle upgrade - parts of site now not usable (3.1.5)

by Mark B -

Just thought that i would give an update on this to help other users who may come across a similar issue.


Basically the coursecatlib errors were commenting that the same class was being re-declared more than once.  To get around this i did a check to see if the class didn't already exist; if so then declare it again, otherwise don't declare it.

The coursecatlib.php file has 3 classes within it and they were all being re-declared it would seem.  I have now put the following code around each class and my errors then went.

if(!class_exists("classname")){

//class goes inside here

}

No more broken site and everything is working again now.  I have one small bug on my moodle which is to do with an external plugin...otherwise it is solved