Open rebelmusic opened 1 year ago
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?
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.
Seems this has been taken care of in https://github.com/litespeedtech/lscache-drupal/commit/310e4bdf6c8af48948b9b80c77d44ff6e13ff6a1.
Please create a new release with that as soon as possible. Thanks.
After upgrading Litespeed from 1.2 to 1.3, I am getting WSOD. Upon checking the logs, I see this:
I can see from this latest commit that MAIN_REQUEST is being used instead of MASTER_REQUEST.
MASTER_REQUEST is required for HttpKernelInterface:
Would be great if this can be fixed asap as I cannot use Litespeed anymore. I'll need to revert to 1.2 for now.