-
Bug
-
Resolution: Fixed
-
Minor
-
3.9.2
-
-
MOODLE_39_STABLE
-
MOODLE_39_STABLE
-
Moodle App 3.9.3
The siteExists function makes a call to Moodle /login/token.php with no parameters:
siteExists(siteUrl: string): Promise<void> {
|
return this.http.post(siteUrl + '/login/token.php', {}).timeout(this.wsProvider.getRequestTimeout()).toPromise()
|
If everything else is configured correctly, /login/token.php fails because of the following PHP line:
$username = required_param('username', PARAM_USERNAME);
|
The app is expecting this failure so it works OK, but this ends up cluttering up the logs with a bunch of entries like this:
[18-Sep-2020 06:24:28 Europe/London] Default exception handler: A required parameter (username) was missing Debug: Error code: missingparam
- line 494 of /lib/setuplib.php: moodle_exception thrown
- line 562 of /lib/moodlelib.php: call to print_error()
- line 34 of /login/token.php: call to required_param()
Which makes it harder to spot genuine errors in the server logs. [I came across this error while trying to track down a problem...]
I suggest this should be changed so that:
- the app sends a specific parameter such as appsitecheck=1 when making this request
- the Moodle code is changed so that if this optional parameter is supplied, then it exits without an error (before doing the require_param line above).
This should not cause any problems relating to versioning because behaviour would be the same as present if either an older app version, or older Moodle version, were used.
- has been marked as being related by
-
MDL-69759 Web services: app checks to token.php cause errors in log
- Closed