1

I just tried to login and I got this error message that I've never seen before.

0 Call to a member function purgePrivate() on null

I'm not sure what would have caused it.

It's PHP 7.3.

Interestingly I was on PHP7.4 but the redirect system didn't work so only my homepage showed.

3
  • Can you offer more context regarding this method which does not have its expected object? Any additional/relevant debugging details will be beneficial. Mar 28, 2021 at 23:51
  • What sort of information would be useful Mick? It's started happening commonly on one of my sites. Already you have helped me, I could do a search for purgePrivate and see where it is in my code. I'll try that then if it's a component I can report it.
    – Eoin
    Mar 30, 2021 at 7:20
  • Found it thanks to your hint. Much appreciated @mickmackusa
    – Eoin
    Mar 31, 2021 at 20:42

2 Answers 2

2

This is from Litespeed Cache. It is somehow related to the Joomla Login. You can test this is true by uninstalling the Litespeed Cache plugin.

I went into cPanel and I went to Terminal and I did a search by copying and pasting this (right click to paste)

grep -Ri purgeprivate public_html

and it found:

$this->plugin->lscInstance->purgePrivate("com_virtuemart.cart");

Problem found. Solution awaiting. Raised on GitHub here:

https://github.com/litespeedtech/lscache-joomla/issues/42

1

Open lscache.php file it's in the folder httpdocs/plugins/system/lscache Comment on this Line 549

public function onUserAfterLogin($options) {
    if (!$this->cacheEnabled) {
        return;
    }

    if ($this->app->isAdmin()) {
        return;
    }
    $this->lscInstance->checkPrivateCookie();
    $this->checkVary();
    if ($this->esiEnabled) {
        $this->lscInstance->purgeAllPrivate();
        $this->log();
    }
}

public function onUserAfterLogout($options) {
    if (!$this->cacheEnabled) {
        return;
    }

    if ($this->app->isAdmin()) {
        return;
    }
    $this->checkVary();
    if ($this->esiEnabled) {
        $this->lscInstance->purgeAllPrivate();
        $this->log();
    }
}

public function onUserLoginFailure($respond) {
    $this->lscInstance->purgePrivate('joomla.login');
    $this->log();
}

Then try to login After that, uninstall LiteSpeed Cache Plugin.

2
  • 1
    But uninstalling isn't fixing the problem; it is making the problem go away. What if you actually want the plugin and just need it to work properly? Jan 6, 2023 at 10:03
  • Thanks for posting @Devi Renada, welcome to the community, we need helpful people like you. Do you know what this functionality actually does? What would I be losing by commenting this? It's an Open Source project, hopefully we can submit the code on Github to fix it for everyone. github.com/litespeedtech/lscache-joomla
    – Eoin
    Jan 9, 2023 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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