hi!,
When i want show the results of my course. appear the following error.
my moodle version is 2.6 and i do not modify the php or other things. or i guess
I'm not sure how much the grade module has changed recently (I don't have access to a v2.6), but that error would suggest it is more about a custom grade change I suggest. So have you added a custom grade schema at some point?
Uhhhhh .... moodle appears to be a version 3.0.x. Check again.
What's in 'inper' directory and in 'neuro' directory. Those aren't typical directories one gets with Moodle 3.0 code.
'spirit of sharing', Ken
Perhaps the root of his Moodle install isn in ...../html/inper/neuro ??
This is something to do with - https://docs.moodle.org/26/en/Grade_export#User_profile_fields_export
Sounds like a bunch of custom profile fields have got messed up. May not be related to the Gradebook at all.
Good catch, Howard! Think I would agree. Quite a difference in how Grade export was set up in 2.6 from 3.0 (which is what the OP has).
Latest docs on Grade export: https://docs.moodle.org/35/en/Grade_export is for 3.5 version of Moodle. Might be a difference in earlier versions of 3.
The 2.6 link Howard provided goes right to that section related.
Here's same link for 3.5:
https://docs.moodle.org/35/en/Grade_export#User_profile_fields_export
and for 3.0
https://docs.moodle.org/30/en/Grade_export#User_profile_fields_export
'spirit of sharing', Ken
I must be missing something... he says he has 2.6. Why don't you agree?
The code reporting the error at line 2754 in 2.6 is just what you would expect:
https://github.com/moodle/moodle/blob/MOODLE_26_STABLE/grade/lib.php#L2754
In 3.0, it's a foreach loop which couldn't cause that error:
https://github.com/moodle/moodle/blob/MOODLE_30_STABLE/grade/lib.php#L2754
Hmmm ... you asking me how I know he's running a 3.x and not a 2.6.x. It's not a secret, but it is something I probably shouldn't disclose here ... even though it's widely known. Hint: files in certain directories meant for developers. Am NOT hacking!!!
Very security minded server admins would either remove those files OR have apache/web service configuration additions to deny access to them except certain IP addresses - remote support. Like protecting the hidden .git directory for those that use git to maintain their Moodles (you, yourself, mentioned that one day in a response to someone) - which I don't think is in Moodle docs/FAQ's anywhere. That was a very good suggestion, BTW.
For me, it's 'white hat remote support' for users less inclined to wanna know internet services details - even though they should stretch a little. Many, as we know, depend upon providers to handle security and there are some providers who take that charge seriously AND they do remove those files.
'spirit of sharing', Ken
Yeh yeh - I know all that.
But that lib file is 2.6 not 3.0. So.... someone has done something weird.
I don't understand... i am new in moodle and my boss said me solve this error.
the answer is upgrade the moodle version or modify the settings of export results
Can't speak for Howard, but am certain he'd also recommend upgrading.
But ... since the site has issues right now, those would come into play when upgrading.
So please answer the question about what's in those directories.
Upgrading your site will require some other changes ... depending upon the end version ... highest is 3.5.1 right now. So to get a handle on those, login as Admin level user to the moodle. Go to site admin -> Server -> Environment check. Update that component (link for it in upper right hand corner of the environment screen).
Then, after your moodle has acquired the appropriate/updated files for checking the environment, the drop down pick list should show your current version. Select from that drop down desired destination version of Moodle. The table generated will show things you need to do ... like PHP needs to be upgraded ... or PHP extension needs to be installed and activited ... and, very important now is database requirements.
That then give you a road map for what you need to do for upgrading .... PHP upgrades, for example, are operating system and package manager tasks (appears you are running Linux but we don't know what 'flavor') and are outside the scope of what Moodle does.
Following link for 3.5 and it should be close to what you need to do/check, etc. AFTER resolving the current issue of grade link errors.
https://docs.moodle.org/35/en/Upgrading
Hoping that helps!
'spirit of sharing', Ken
I'm going to guess what has happened.
- You used to have 2.6.
- Someone made modifications in core Moodle code. Probably to modify the grade export in some way (bad idea)
- You upgraded to 3.0
- You copied the modified 2.6 files into 3.0 in the hope of maintaining your modified functions,
You now have a broken site.
My advice is to *completely* replace your Moodle code with a clean copy of 3.0. You will lose any custom modifications. You have just found out why making core modifications is a bad plan. As Ken said, you can then think about upgrading to 3.5 (as 3.0 is no longer supported).
The right thing to do was to create a custom grade export plugin - by first cloning a core one.
Knew you knew that!
That's why I asked what was in those two directories.
So yes, someone has done something ... shall we say ... 'different'!
In the 2.6 one had to copy a URL into a dialog box it looks like. In higher versions, not so.
So might be running a 3 but due to that URL which am almost certain is stored in DB somewhere site is confused.
I see by the OP's next posting, is not understanding ... but in response to I guess the question, should site be upgraded ... I'd say yes.
'spirit of sharing', Ken
ok, i tell you.
the people tell me that moodle are inside of other moodle.
inper is the main moodle and neuro is the moodle that have the problem when i show the results.
the first moodle (inper) i don't know the version. everything was estable, but some one change something (i don't know what happend) and the moodle break.
i know, it's a bad idea have a moodle inside of a moodle. but my job is solve this problem and i never used moodle
ahhh.....
I'm not sure what to say. I'm not sure we can help you.
You need someone who knows what they are doing to look at your installation, work out what has happened. And put this right.
Please don't take this badly but you have a system that looks like it was installed by someone who didn't know what they were doing. It is now trying to be fixed by someone who does not know what they are doing.
My solution is to take the two installs - which really means their database and 'moodledata' areas, and make two new installs with all new code that are definitely not inside each other. That would be a good start.
At the moment you have two intertwined installs - almost certainly with mixed up versions of code. That's pretty bad. There's no fixing that. You have to start again.
This is gonna get frustrating for you, but ... can't give specific detail answers and or fixes.
"the people tell me that moodle are inside of other moodle."
You already know it's a bad idea to have a moodle in a moodle. Agreed. But ...
Have you actually looked at the file system level? You have to cause we can't! A moodle has a config.php file at it's root. Is there a config.php file in those directories I asked you to look at? A moodle also has a version.php file at the same location/folder as the config.php file. That file, tells you the version of Moodle.
Howard is correct in that someone before you did something in-correctly and probably left no server documentation for you to use and figure out what's what and where. And we certainly cannot tell you.
Accessing the moodle site in the /neruo/ directory is done with a different URL? That's not really something you need to share here ... read further down ...
I have to ask this ... not meaning to confuse you ... but since I can't seem to reach https://site/neuro/ where you say the problem resides, in the configuration of the web server's main config file ... which should be in /etc/httpd/conf/httpd.conf
At the bottom of that file are there 'Virtual host' sections?
They look like:
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
Is there anything for /neruo/ there?
'spirit of sharing', Ken
Just beware... each Moodle install has several config.php files and loads of version.php files. Ken's referring to the ones in the 'root' of the Moodle install but if things are messed up, neither of these files uniquely identifies the Moodle root.