1

Currently facing the following error in the cp_js_end hook.

Undefined property: Javascript::$session 

it looks like the session class isn`t loading anymore in EE 2.6+ It whas working in older versions.

Is this a bug, or did EL change the way of loading the session class in some other order?

Example:

function cp_js_end()
{
   print_r(ee()->session);
}
1

Just found a way to avoid this problem

I change the hook from cp_js_end to the cp_menu_array hook.

Will work
function cp_menu_array($menu)
{
    print_r(ee()->session)
}

Please make sure that you not returning your JS but add your js with to the with ee()->cp->add_to_foot('<script type="text/javascript"></script>');

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.