Error after creating new user

Error after creating new user

by Derek Chirnside -
Number of replies: 9

Moodle 3.0.2+  Created new user, "send email with password"  They got an error (which I don't have) so I changed the password, and tried to log in and get this:

Coding error detected, it must be fixed by a programmer: 
session_is_loggedinas() is removed, use 
\core\session\manager::is_loggedinas() instead

Any suggestions?  Or is it "switch error tracking on, do the whole thing over and see if I get more information".

-Derek

Average of ratings: -
In reply to Derek Chirnside

Re: Error after creating new user

by Derek Chirnside -

OK, some more data.

  1. Admin creates account, email password option
  2. Try to log in using UN and Password from email, get this error:
Coding
 error detected, it must be fixed by a programmer: 
session_is_loggedinas() is removed, use 
\core\session\manager::is_loggedinas() instead

Then, if I try to login it says "You are logged in as <new user>" and clicking Logout clears the logjam


-Derek



In reply to Derek Chirnside

Re: Error after creating new user

by Adrian Jarratt -

Hi Derek

I'm afraid I have just had a similar experience (Moodle 3.0)

Having created new users with 'changeme' as password and force change password in the csv upload, I tried to 'log in as' via the user profile page.

The error message was:

Coding error detected, it must be fixed by a programmer: session_is_loggedinas() is removed, use \core\session\manager::is_loggedinas() instead

Fortunately I had a taken a database backup before the upload.

I retried the 'log in as' after rolling back the database, but got the same problem.

Hoping some has an answer smile

Adrian

In reply to Adrian Jarratt

Re: Error after creating new user

by Daniel meanock -

Ive got the same, did you solve this ? 


Thanks 

In reply to Daniel meanock

Re: Error after creating new user

by Adrian Jarratt -

We have solved this (I believe).  It seems that the issue is to do with deprecated code in Moodle 3 causing a problem with the Decaf theme.

You will find more information in https://git.in.moodle.com/amosbot/moodle-install/blob/1c2b7882564e21a7addfadd82d79e226ca77380e/lib/deprecatedlib.php see around lines 418 - 440

I use a custom version of decaf and made the following change in theme_name/layout/navbar.inc.php
(line 18 in our custom theme)

Change: session_is_loggedinas()

TO

\core\session\manager::is_loggedinas()

Hope this helps

Adrian

In reply to Adrian Jarratt

Re: Error after creating new user

by Daniel meanock -

Hi Adrian,

Thanks very much for your help

Thats what i though something simple like that!  Just can't find where to alter this code, the error is very self explanatory but doesn't tell you where to locate the code.. 

I cannot find the mentioned file "navbar.inc.php" within my theme, under the layout folder.


Is there anywhere else this could be located?


Thanks In Advance!! smile


Attachment shot 1.png
In reply to Daniel meanock

Re: Error after creating new user

by Adrian Jarratt -

Hi Daniel

I'm not familiar with the Saga theme.  All I can suggest is that you open each php file and search (Ctrl F on windows) for  'session_is_loggedinas()'  then change.

Good luck!

Adrian

In reply to Adrian Jarratt

Re: Error after creating new user

by Daniel meanock -

Hi Adrian


Right I've been through all those php files within layout and non contain "session_is_loggedinas()" or anything like it, the only one that comes close is the header.php one which contains if(isloggedin()) (see full php code below)

the Unfortunately the developer of this theme no longer supports updates etc.. so has left me a bit in the lurch considering i build this for a college which sells online courses..


Thanks Mate


Regards

Dan


<?php 
    $menubar = empty($PAGE->layout_options['nomenubar']);
    $noslider = !empty($PAGE->layout_options['noslider']);
    $topbutton = (isset($PAGE->layout_options['topbutton']))?$PAGE->layout_options['topbutton']:'logout';
?>

<div id="topbar" class="row">
    <div class="sklt-container">
        <div class="sixteen columns">
            <?php echo $OUTPUT->socialicons('header'); ?>
        
            <?php
                switch ($topbutton) {
                    case 'home':
                        echo '<div id="home" class="topbutton"><a href="'.$CFG->wwwroot.'">'.get_string('home','theme_saga').'</a></div>';
                    break;
                    default:
                        if(isloggedin())
                            echo '<div id="logout" class="topbutton"><a href="'.$CFG->wwwroot.'/login/logout.php">'.get_string('logout','theme_saga').'</a></div>';
                        else
                            echo '<div id="login" class="topbutton"><a href="'.$CFG->wwwroot.'/login">'.get_string('login','theme_saga').'</a></div>';
                }
            ?>

            <?php 
                if(isloggedin() && get_config('theme_saga', 'loggedAs')){
                    echo '<p id="topText"> '.$OUTPUT->login_info(false).'</p>';
                }else if(!isloggedin() && get_config('theme_saga', 'registerLink')){
                    echo '<p id="topText"><a href="'.$CFG->wwwroot.'/login/signup.php">'.get_string('register','theme_saga').'</a></p>';
                }
            ?>
        </div>
    </div>
</div>

<?php if($menubar) { 
        $fixedmenu = get_config('theme_saga','fixedmenu');

echo        '<div id="menubar" class="row'.(($fixedmenu)?' canfix':'').'">
                    <div class="sklt-container">
                        <div class="four columns">
                            <a href="'.$CFG->wwwroot.'">'.$OUTPUT->logo().'</a>
                            '.$this->responsive_menu().'
                        </div>
                        <div class="twelve columns">'.$OUTPUT->menu($CFG->wwwroot).'</div>
                    </div>
            </div>';
} ?>
In reply to Adrian Jarratt

Re: Error after creating new user

by Derek Chirnside -

You are right Dan, Saga is no longer supported.  I suspect there will be an alternative as a way forwards

http://themeforest.net/item/saga-responsive-moodle-theme/5669197

I wonder if it uses AwesomeBar from Decaf?

??

Is there any more clarity about if or if not this is a Decaf or AwesomeBar problem here?  

I use Flexibase (which has the AB built in) for the main theme on our site.  Tonight I will try this with Clean.  

-Derek

In reply to Derek Chirnside

Re: Error after creating new user

by Daniel meanock -

Thanks Derek,  


I can't see any sign of awesome bar, would this be shown as a plugin within the theme directory?


This is still giving me a headache and am considering moving themes but not sure if the client can fund the work to change all of this! , i can't believe they are not supporting this theme, envato needs to clamp down on this, Ararazu is allowed to just ditch a theme after 12 months but continue to sell other themes??  If he's not committed they need to pull him out of the marketplace! 


Shame though as I have had some great themes and good support.


Thanks 

Dan