error/block exaport/loginasmode need details

error/block exaport/loginasmode need details

by rob davis -
Number of replies: 3

Moodle v 3.3.1 


After logging in as the site administrator then using "login as" a student and then clicking "My Portfolio Artifacts"

gives an error

You can't access portfolios in 'Login As'-Mode.

More information about this error


Which links to 

https://docs.moodle.org/33/en/error/block_exaport/loginasmode

which in turn links to 

https://docs.moodle.org/34/en/error/block_exaport/loginasmode


which then suggests I create a post on this forum.


I have done quite a bit of Googling and searching on these forums but can find nothing about this error.


Has anyone got any documentation on the error and what I need to do to bypass it, please?

Average of ratings: -
In reply to rob davis

Re: error/block exaport/loginasmode need details

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This seems to relate to an option plugin, 'Exabis Portfolio'? I'd not heard of it, so I can't help you directly. 

However, you might get on better creating an issue, here, https://github.com/gtn/exaport/issues

In reply to Howard Miller

Re: error/block exaport/loginasmode need details

by rob davis -

i appreciate you replying, i had no idea that the Exabis Portfolio was not part of Moodle, I did not install it.


Bit odd that their plugin creates a Moodle system error message that then links to the core Moodle documentation.


Anyway, I had a look at their source code and found


/lib/lib.php: 


if (empty($CFG->block_exaport_allow_loginas)) {

// login as not allowed => check

global $USER;

if (!empty($USER->realuser)) {

print_error("loginasmode", "block_exaport");

}

}


I  am not a PHP developer but, it looks like that the config value "block_exaport_allow_loginas" defaults to not allowing "login as mode".


That means it is either an easy fix to set that config value to "not empty" and it will just work or the developers but it in to stop a serious problem happening when using "login as mode" and put this code to facilitate a fix in the future ...

In reply to rob davis

Re: error/block exaport/loginasmode need details

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

One would assume that loginas is not allowed because it would spectacularly break in some way if they didn't simply exit with an error. 

It's not directing to core documentation as such. Just any properly formulated error will point to a path in the documentation. The plugin developers have the opportunity to expand on those errors in the wiki.