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

out_as_local_url called on a non-local URL #67

Open
nadavkav opened this issue Aug 31, 2021 · 5 comments
Open

out_as_local_url called on a non-local URL #67

nadavkav opened this issue Aug 31, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@nadavkav
Copy link

While upgrading to latest version (2021080400), I got the following error message (CLI)
!!! Coding error detected, it must be fixed by a programmer: out_as_local_url called on a non-local URL !!!

It seems to be referring to settings.php
$returnurl = $PAGE->url->out_as_local_url(false);

I am using Moodle 3.9.8

@nadavkav nadavkav added the bug Something isn't working label Aug 31, 2021
@bcaballero
Copy link

Do you have any recommended versions to avoid this error? It is a blocker upgrading from 0.4.2 2021020300 to 1.0.1 2021080400.

@Kemmotar83
Copy link

Hi,

since the "returning URL" is always the same, I have temporarily "solved" the error replacing that row with the following one (with the "hardcoded URL").

$returnurl = new moodle_url('/admin/settings.php?section=qtypesettingshortmath');

It works and this could fix the error.

Giorgio

@nadavkav
Copy link
Author

nadavkav commented Sep 29, 2021

Here is what I did, and found useful:

// Link to configuration manager page.
    if (empty($CFG->upgraderunning)) {
        $returnurl = $PAGE->url->out_as_local_url(false);
    } else {
        $returnurl = '';
    }

If this make sense to you, I can send a PR.

@mrkskwsnck
Copy link

Hi,

since the "returning URL" is always the same, I have temporarily "solved" the error replacing that row with the following one (with the "hardcoded URL").

$returnurl = new moodle_url('/admin/settings.php?section=qtypesettingshortmath');

It works and this could fix the error.

Giorgio

@Kemmotar83 Your temp fix works 4 me. Thankx

@brendanheywood
Copy link

@andstor could we please have a review of this trivial fix:

#70

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

5 participants