Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

core_message_search_contacts problem

$
0
0
by Javier Benito García-Mochales.  

Hi.

I'm developing an external Moodle v2.5 web services library in python for my thesis.

I created a web service with all no deprecated functions and I had no problems to use any of them until I tried to use the core_message_search_contacts function.

When I use this function with a search string that matches with any result, I get a HTTP 500 internal server error. When I searched in my apache web server log file I found this:

PHP Fatal error:  Call to undefined function user_get_user_details() in /var/www/moodle/message/externallib.php on line 540

Looking in the specified file I saw that user_get_user_details() is a function defined in /user/lib.php, but no "require" sentence appears in search_contacts function.

So I added this line after the "require_once($CFG->libdir . '/enrollib.php');" sentence (line 501), at the begining of the search_contacts function:

        require_once($CFG->dirroot . '/user/lib.php');

and everything started going fine.

I'm new in php but I think that this is neccesary in order to that this function works well.

If I'm wrong I would like to know what should I do to work with this function or why I get this 500 internal server error.

 

PD: I have the Moodle 2.5 Stable version, Mysql Ver 14.14 Distrib 5.1.69, Apache 2.2.14 and PHP 5.3.6.


Viewing all articles
Browse latest Browse all 2361

Trending Articles