Learn2Care

Welcome Back

Sign in to access your dashboard.

Whoops! There was an error.
Whoops \ Exception \ ErrorException (E_USER_NOTICE)
Callback before_footer in local_carecoach component should be migrated to new hook callback for core\hook\output\before_footer_html_generation Whoops\Exception\ErrorException thrown with message "Callback before_footer in local_carecoach component should be migrated to new hook callback for core\hook\output\before_footer_html_generation" Stacktrace: #4 debugging in /data/preprod-learn2care_portal/learn2care_portal/lib/moodlelib.php:7264 #3 {closure} in /data/preprod-learn2care_portal/learn2care_portal/lib/moodlelib.php:7331 #2 get_plugins_with_function in /data/preprod-learn2care_portal/learn2care_portal/lib/classes/hook/output/before_footer_html_generation.php:71 #1 core\hook\output\before_footer_html_generation:process_legacy_callbacks in /data/preprod-learn2care_portal/learn2care_portal/lib/classes/output/core_renderer.php:975 #0 core\output\core_renderer:footer in /data/preprod-learn2care_portal/learn2care_portal/login/index.php:514
Stack frames (5)
4
debugging
/lib/moodlelib.php7264
3
{closure}
/lib/moodlelib.php7331
2
get_plugins_with_function
/lib/classes/hook/output/before_footer_html_generation.php71
1
core\hook\output\before_footer_html_generation process_legacy_callbacks
/lib/classes/output/core_renderer.php975
0
core\output\core_renderer footer
/login/index.php514
/data/preprod-learn2care_portal/learn2care_portal/lib/moodlelib.php
    global $CFG;

    if (during_initial_install() || isset($CFG->upgraderunning)) {
        // API functions _must not_ be called during an installation or upgrade.
        return [];
    }

    $plugincallback = $function;
    $filtermigrated = function($plugincallback, $pluginfunctions): array {
        foreach ($pluginfunctions as $plugintype => $plugins) {
            foreach ($plugins as $plugin => $unusedfunction) {
                $component = $plugintype . '_' . $plugin;
                $hookmanager = di::get(hook\manager::class);
                if ($hooks = $hookmanager->get_hooks_deprecating_plugin_callback($plugincallback)) {
                    if ($hookmanager->is_deprecating_hook_present($component, $plugincallback)) {
                        // Ignore the old callback, it is there only for older Moodle versions.
                        unset($pluginfunctions[$plugintype][$plugin]);
                    } else if ($hookmanager->warn_on_unmigrated_legacy_hooks()) {
                        $hookmessage = count($hooks) == 1 ? reset($hooks) : 'one of  ' . implode(', ', $hooks);
                        debugging(
                            "Callback $plugincallback in $component component should be migrated to new " .
                                "hook callback for $hookmessage",
                            DEBUG_DEVELOPER
                        );
                    }
                }
            }
        }
        return $pluginfunctions;
    };

    $cache = \cache::make('core', 'plugin_functions');

    // Including both although I doubt that we will find two functions definitions with the same name.
    // Clean the filename as cache_helper::hash_key only allows a-zA-Z0-9_.
    $pluginfunctions = false;
    if (!empty($CFG->allversionshash)) {
        $key = $CFG->allversionshash . '_' . $function . '_' . clean_param($file, PARAM_ALPHA);
        $pluginfunctions = $cache->get($key);
    }
/data/preprod-learn2care_portal/learn2care_portal/lib/moodlelib.php
                    // Include the files if it was requested.
                    include_once($allplugins[$plugin] . DIRECTORY_SEPARATOR . $file);
                } else if (!$fileexists) {
                    // If the file is not available any more it should not be returned.
                    $dirty = true;
                    break 2;
                }

                // Check if the function still exists in the file.
                if ($include && !function_exists($function)) {
                    $dirty = true;
                    break 2;
                }
            }
        }

        // If the cache is dirty, we should fall through and let it rebuild.
        if (!$dirty) {
            if ($migratedtohook && $file === 'lib.php') {
                $pluginfunctions = $filtermigrated($plugincallback, $pluginfunctions);
            }
            return $pluginfunctions;
        }
    }

    $pluginfunctions = array();

    // To fill the cached. Also, everything should continue working with cache disabled.
    $plugintypes = \core_component::get_plugin_types();
    foreach ($plugintypes as $plugintype => $unused) {

        // We need to include files here.
        $pluginswithfile = \core_component::get_plugin_list_with_file($plugintype, $file, true);
        $installedplugins = $pluginmanager->get_installed_plugins($plugintype);
        foreach ($pluginswithfile as $plugin => $notused) {

            if (!isset($installedplugins[$plugin])) {
                continue;
            }

/data/preprod-learn2care_portal/learn2care_portal/lib/classes/hook/output/before_footer_html_generation.php
    public function add_html(?string $output): void {
        if ($output) {
            $this->output .= $output;
        }
    }

    /**
     * Returns all HTML added by the plugins
     *
     * @return string
     */
    public function get_output(): string {
        return $this->output;
    }

    /**
     * Process legacy callbacks.
     */
    public function process_legacy_callbacks(): void {
        $pluginswithfunction = get_plugins_with_function(function: 'before_footer', migratedtohook: true);
        foreach ($pluginswithfunction as $plugins) {
            foreach ($plugins as $function) {
                $extrafooter = $function();
                if (is_string($extrafooter)) {
                    $this->add_html($extrafooter);
                }
            }
        }
    }
}
 
/data/preprod-learn2care_portal/learn2care_portal/lib/classes/output/core_renderer.php
        $PAGE = $this->page;
        $COURSE = $this->page->course;

        ob_start();
        include($layoutfile);
        $rendered = ob_get_contents();
        ob_end_clean();
        return $rendered;
    }

    /**
     * Outputs the page's footer
     *
     * @return string HTML fragment
     */
    public function footer() {
        global $CFG, $DB, $PERF;

        $hook = new before_footer_html_generation($this);
        $hook->process_legacy_callbacks();
        di::get(hook_manager::class)->dispatch($hook);
        $hook->add_html($this->container_end_all(true));
        $output = $hook->get_output();

        $footer = $this->opencontainers->pop('header/footer');

        if (debugging() and $DB and $DB->is_transaction_started()) {
            // TODO: MDL-20625 print warning - transaction will be rolled back
        }

        // Provide some performance info if required
        $performanceinfo = '';
        if (MDL_PERF || (!empty($CFG->perfdebug) && $CFG->perfdebug > 7)) {
            if (MDL_PERFTOFOOT || debugging() || (!empty($CFG->perfdebug) && $CFG->perfdebug > 7)) {
                if (NO_OUTPUT_BUFFERING) {
                    // If the output buffer was off then we render a placeholder and stream the
                    // performance debugging into it at the very end in the shutdown handler.
                    $PERF->perfdebugdeferred = true;
                    $performanceinfo .= html_writer::tag(
                        'div',
/data/preprod-learn2care_portal/learn2care_portal/login/index.php
$PAGE->set_title($loginsite);
$PAGE->set_heading("$site->fullname");

echo $OUTPUT->header();

if (isloggedin() and !isguestuser()) {
    // prevent logging when already logged in, we do not want them to relogin by accident because sesskey would be changed
    echo $OUTPUT->box_start();
    $logout = new single_button(new moodle_url('/login/logout.php', array('sesskey'=>sesskey(),'loginpage'=>1)), get_string('logout'), 'post');
    $continue = new single_button(new moodle_url('/'), get_string('cancel'), 'get');
    echo $OUTPUT->confirm(get_string('alreadyloggedin', 'error', fullname($USER)), $logout, $continue);
    echo $OUTPUT->box_end();
} else {
    $loginform = new \core_auth\output\login($authsequence, $frm->username);
    $loginform->set_error($errormsg);
    $loginform->set_info($infomsg);
    echo $OUTPUT->render($loginform);
}

echo $OUTPUT->footer();
 

Environment & details:

empty
empty
empty
Key Value
MoodleSession vrlnvdjd6sefdg7el93iq0cjsp
Key Value
USER stdClass Object ( [id] => 0 [mnethostid] => 1 [sesskey] => R8yNwn1vC2 [preference] => Array ( ) )
SESSION stdClass Object ( [isnewsessioncookie] => 1 [wantsurl] => https://preprod.learn2care.us/ [loginredirect] => 1 [cachestore_session] => Array ( [default_session-core/navigation_cache] => Array ( [__lastaccess__u0_vrlnvdjd6sefdg7el93iq0cjsp] => Array ( [0] => 1789652633 [1] => 1789652633 ) ) ) [logintoken] => Array ( [core_auth_login] => Array ( [token] => oVo3Squlu4GlpLNxXYNl88BmycSsYxlT [created] => 1789652633 ) ) )
Key Value
USER preprod-learn2care_portal
HOME /data/preprod-learn2care_portal/
HTTP_COOKIE MoodleSession=vrlnvdjd6sefdg7el93iq0cjsp
HTTP_X_FORWARDED_PROTO https
HTTP_CF_VISITOR {"scheme":"https"}
HTTP_CF_IPCOUNTRY US
HTTP_CF_CONNECTING_IP 216.73.216.65
HTTP_CDN_LOOP cloudflare; loops=1
HTTP_ACCEPT_ENCODING gzip, br
HTTP_CF_RAY a3c88adffe1f86cd-CMH
HTTP_REFERER https://preprod.learn2care.us/sitemap.xml
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_X_FORWARDED_FOR 216.73.216.65
HTTP_HOST preprod.learn2care.us
REDIRECT_STATUS 200
SERVER_NAME preprod.learn2care.us
SERVER_PORT 443
SERVER_ADDR 10.5.0.6
REMOTE_USER
REMOTE_PORT 9710
REMOTE_ADDR 172.71.28.197
SERVER_SOFTWARE nginx/1.24.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /data/preprod-learn2care_portal/learn2care_portal
DOCUMENT_URI /login/index.php
REQUEST_URI /login/index.php
SCRIPT_NAME /login/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /data/preprod-learn2care_portal/learn2care_portal/login/index.php
PATH_INFO
FCGI_ROLE RESPONDER
PHP_SELF /login/index.php
REQUEST_TIME_FLOAT 1789652633.6075
REQUEST_TIME 1789652633
empty
0. Whoops\Handler\PrettyPageHandler
1. Whoops\Handler\CallbackHandler