user/lib.php truncated after upgrade...

user/lib.php truncated after upgrade...

by Andrew Steele -
Number of replies: 2

Greetings!

Over the weekend an issue came to light which may have been around for awhile - I cannot tell but this is my story...

I host three separate Moodle sites on my server for separate clients. 

Yesterday we were running Moodle 2.8.5

Yesterday, while trying to choose a better theme for mobile use to try and keep up with the new Google algorithm I chose the pretty standard CLEAN theme.  When it was selected I discovered that whenever I logged in I got an error:

    Fatal error: Call to undefined function user_get_user_navigation_info() in
    <site directory>/lib/outputrenderers.php on line 2977

Some great advice in the forums pointed me to user/lib.php and I discovered that it had been truncated. I copied the lib.php file from one of the working sites which was twice the size and the broken site then worked just fine.

I made a mental note to keep an eye on this issue.

This morning I got the advice about the latest security updates. I decided to bite the bullet and also upgrade to Moodle v2.9.

I discovered that with the one site I had problems with yesterday a similar issue arose when running the upgrade process. Again I checked user/lib.php and it was half the size of the same file on the other sites.

I copied one over and everything was working again.

I am, however, stuck as to where I should be going with this.

Any suggestions.... please?

Andrew


Average of ratings: -
In reply to Andrew Steele

Re: user/lib.php truncated after upgrade...

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moodle cannot truncate a Moodle file. It *definitely* can't if you have the permissions set correctly - that is the web server user should *only* be able to read the Moodle program files. 

So, I would start by carefully checking your permissions. 

Other than that it is strange - but not a Moodle issue per se. 

I would also run a full check on your disks. 

In reply to Howard Miller

Re: user/lib.php truncated after upgrade...

by Andrew Steele -

Thanks Howard...

I was already working on the solution and I discovered that it was an old copy of the lib.php file which had become secreted in our site specific files which kept getting copied back after each and every upgrade.

I'm not sure when this happened but having located the artefact it is easy to resolve.

Thanks for taking the time to reassure me ;)

Andrew