All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Unable to load the requested class: low_variables_settings

Emily Raymond 7 Feb 2019 20:15 question, complete

Hello,

I just upgraded EE from 2.6 to 3.5 to 5.1.12. I am getting an error that says:

Unable to load the requested class: low_variables_settings

It appears that when the libraries array is loaded at system/user/addons/low_variables/base.low_variables.php:

ee()->load->library($this->libraries);

The Loader.php at system/ee/legacy/core/Loader.php cannot find the correct path to the file.

Anyone face this issue before?

Replies

  1. Emily Raymond 7 Feb 2019 21:05

    More details:

    _ci_load_class() in system/ee/legacy/core/Loader.php is being called five times for each of the low_variables library.

    The first call to _ci_load_class() exits normally at:
    return $this->_ci_init_class()

    The second and third call to _ci_load_class() exit as duplicates at:
    $is_duplicate = TRUE;
    log_message('debug', $class." class already loaded. Second attempt ignored.");
    return;

    The fourth call to _ci_load_class() causes the issue. The correct path is no longer in $this->_ci_library_paths so the following code is run:

    if ($subdir == '')
    {
    $path = strtolower($class).'/'.$class;
    return $this->_ci_load_class($path, $params);
    }

    Because of that, _ci_load_class() runs for the fifth time with the
    $class='low_variables_settings/low_variables_settings'

    This last call if actually what causing the error message:
    Unable to load the requested class: low_variables_settings

    I created a temporary fix for all the low_variables libraries in my Loader.php function; however, I am not sure what the root cause of the issue is.

    Any ideas?

  2. Low 8 Feb 2019 12:39

    Hmm, path issues like these are intermittent and a pain to debug...

    What version of LV are you running?

  3. Emily Raymond 8 Feb 2019 17:27

    Thanks for the quick reply. I am really stuck on this issue.

    I am using 3.2.0 LV.

  4. Low 8 Feb 2019 17:56

    As I cannot replicate this myself, can you try the following...

    Open up base.low_variables.php and look up line 117 - 119, which read:

    ee()->load->helper($this->package); 
    ee()->load->library($this->libraries);
    ee()->load->model($this->models);


    ...change that to:

    ee()->load->add_package_path(PATH_THIRD.$this->package); 
    ee()->load->helper($this->package);
    ee()->load->library($this->libraries);
    ee()->load->model($this->models);
    ee()->load->remove_package_path(PATH_THIRD.$this->package);


    ...and see if that resolves the issue.

  5. Emily Raymond 11 Feb 2019 21:51

    Thank you so much for your help! This change fixed the issue I was having. I really appreciate your quick replies!