litespeedtech / magento2-LiteSpeed_LiteMage

LiteMage Cache Extension for Magento 2

Home Page:https://www.litespeedtech.com/products/litespeed-web-cache/litemage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Force cache flush in Admin causes crash: Undefined variable: tags1

AdamBorealis opened this issue · comments

2.1.9 - Doing anything in the backend of Magneto that forces a cache flush (adding a new product for example), it will crash the backend with the following error:

main.CRITICAL: Notice: Undefined variable: tags1 in /public_html/vendor/litespeed/module-litemage/Model/CachePurge.php on line 105 {"report_id":"d170a04e7caf6f2a26d24efe96acff2536294d36e0a91f14c2298938cefbedcf","exception":"[object] (Exception(code: 0): Notice: Undefined variable: tags1 in public_html/vendor/litespeed/module-litemage/Model/CachePurge.php on line 105 at /public_html/vendor/magento/framework/App/ErrorHandler.php:61)"} []

Here's line 105:
$purgeTags = 'tag=' . implode(',tag=', $tags1);

If you still have (or anyone else that has) this issue, the problem is the line above it (line 104).

It has a variable of $tag1 not $tags1.

I changed this and it worked fine for me after that.

Steve.

@envycreative

Nice work catching that 👍

That did seem to fix this problem as I was having the same exact issue and it was very annoying having the page crash like that. Thanks for posting the fix 🙂

Now to tag the devs... @litespeedtech please include this fix in your next update so when you do update this module we won't have to manually make this change again. Thank you!

Is this issue supposed to be fixed?

Is this issue supposed to be fixed?

Hm? 0_o

Maybe you're new to Github or maybe I don't understand the question. But if you look at the commit dates and release dates of the extension, you'll have the answer you're looking for. As shown here:

litemage-github-update-screenshot

You'll see this topic was created Aug 2, 2022 and in the screenshot you'll see the last commit (code change) and update was on May 18, 2022. That would indicate a "no", this has not been fixed - officially.

I feel like LiteSpeed does not pay much attention to the Magento extension unfortunately, as it's dead here from them. But luckily, with the fix posted above by @envycreative the extension does seem to work fine on 2.4.5-p1.

This is resolved in v2.2 relase