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

Error: out_as_local_url called on a non-local URL #13

Open
ignaciogros opened this issue Oct 11, 2024 · 0 comments
Open

Error: out_as_local_url called on a non-local URL #13

ignaciogros opened this issue Oct 11, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ignaciogros
Copy link
Collaborator

ignaciogros commented Oct 11, 2024

We know this happens in Moodle 4.4. It might happen in previous versions too.

Moodle redirects to the Gradebook when there are more than a certain number of saved scores, and the module doesn't check that.

It can be fixed doing this in Moodle's core (course/modedit.php), but the module should check that:

modedit.php original code:

if (isset($fromform->needsfrontendregrade)) {
   $url = new moodle_url('/course/modregrade.php', ['id' => $fromform->coursemodule,
      'url' => $url->out_as_local_url(false)]);
}

Provisional new code:

if (isset($fromform->needsfrontendregrade) && $fromform->modulename != 'exescorm') {
   $url = new moodle_url('/course/modregrade.php', ['id' => $fromform->coursemodule,
      'url' => $url->out_as_local_url(false)]);
}
@ignaciogros ignaciogros added the bug Something isn't working label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants