GithubHelp home page GithubHelp logo

Comments (3)

Code-Egg avatar Code-Egg commented on July 22, 2024

As far as I know that MASTER_REQUEST is deprecated. I tried a fresh Drupal setup with the cache plugin and it seems no issue. Do you have any test site to uninstall the cache plugin, and install the latest version for testing porpuses and see if there's any issue?

from lscache-drupal.

yookoala avatar yookoala commented on July 22, 2024

I've installed v1.3 onto a newly setup Drupal 9 and encountered the same issue.

[10-Aug-2023 03:51:14 UTC] Error: Undefined constant Drupal\lite_speed_cache\StackMiddleware\LiteSpeedCache::MAIN_REQUEST in /home/foobar/web/modules/contrib/lscache-drupal/src/StackMiddleware/LiteSpeedCache.php on line 109 #0 /home/foobar/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\lite_speed_cache\StackMiddleware\LiteSpeedCache->handle()
#1 /home/foobar/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#2 /home/foobar/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#3 /home/foobar/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#4 /home/foobar/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#5 /home/foobar/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#6 /home/foobar/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#7 {main}

Line 109 of LiteSpeedCache.php is this line:

if ($type === static::MAIN_REQUEST && $this->requestPolicy->check($request) === RequestPolicyInterface::ALLOW) {

the const LiteSpeedCache::MAIN_REQUEST is supposedly inherited from Symfony's HttpKernelInterface, but the attribute was only renamed from MASTER_REQUEST to MAIN_REQUEST since version 5.3:

Drupal 9.5.10 has a dependency on "symfony/http-kernel": "^4.4". Which means the HttpKernelInterface in Drupal 9 is still using the old MASTER_REQUEST reference. Not MAIN_REQUEST. So the current v1.3 lscache-drupal only works with Drupal 10 with Symfony 5.3+.

For backward compatibility purpose, I think the class Drupal\lite_speed_cache\StackMiddleware\LiteSpeedCache should explicitly declare public const MAIN_REQUEST = 1; within it.

from lscache-drupal.

yookoala avatar yookoala commented on July 22, 2024

Seems this has been taken care of in 310e4bd.

Please create a new release with that as soon as possible. Thanks.

from lscache-drupal.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.