Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moodle 4.5: incompatible declaration of Katzgrau\KLogger\Logger::log causes JS Error on assign submission grading page #191

Open
llttugraz opened this issue Dec 5, 2024 · 0 comments

Comments

@llttugraz
Copy link

Steps to reproduce

having "Display debug messages" activated and the "Debug messages" set to DEVELOPER:

  1. add an assign activity (in our setup Turnitin was even not enabled)
  2. submit a pdf as a student
  3. open the assign activity as a teacher or manager
  4. click on Grade button
  5. The pdf is opened for annotation but a dialog is poped up as follows:
Bildschirmfoto 2024-12-05 um 11 21 11

Looking in to XHR requests on this page, you find a request to r.php/api/rest/v2/user/current/preferences with the request parameter {"preferences":{"assign_filter":""}} with the following response:

<br/>
<b>Fatal error</b>
:  Declaration of Katzgrau\KLogger\Logger::log($level, $message, array $context = []) must be compatible with Psr\Log\AbstractLogger::log($level, Stringable|string $message, array $context = []): void in 
<b>/home/mdl/src/moodle/plagiarism/turnitinsim/vendor/katzgrau/klogger/src/Logger.php</b>
 on line 
<b>209</b>
<br/>

Reason

Moodle 4.5 provides the very last version of Psr\Log 3.x (to be found under lib/psr/). In this version, the signature is different:

abstract public function log($level, string|\Stringable $message, array $context = []): void;

Apparently the Psr\Log provided in Moodle is considered in Katzgrau\KLogger\Logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant