Refactor for using Drupal core instead of variationcache

Created on 20 December 2023, 6 months ago
Updated 28 February 2024, 4 months ago

On Drupal 10.2 the variation cache already in core.
The VariationCache module not needed.
I think will be good if we can create 2.0 branch for Drupal 10.2 and use 1.1.x for < 10.2.
Read more:
VariationCache module →
New variation cache for caching something with cache contexts (replaces render cache) →

📌 Task
Status

Closed: won't fix

Version

1.1

Component

Code

Created by

🇺🇦Ukraine Ruslan Piskarov Kiev, Ukraine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Ruslan Piskarov
  • 🇺🇦Ukraine Ruslan Piskarov Kiev, Ukraine
  • 🇺🇦Ukraine Ruslan Piskarov Kiev, Ukraine
  • Status changed to Closed: won't fix 5 months ago
  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    This module is now part of core and VC had a release that should work with both D10.2 and below

  • It was still breaking my site when I updated to D10.2 even after updating variationcache to latest (1.5), doing drush updatedb and drush cr. With errors expecting type \Drupal\variationcache\Cache\VariationCacheInterface but getting \Drupal\Core\Cache\VariationCache in flexible_permissions/src/ChainPermissionCalculator.php line 63.

    I ended up making some small modifications to a copy of the flexible_permissions module to use the new Core variation cache instead of the variationcache module. I am not 100% certain I got everything right, but my modified code is working for me.

    @Ruslan-Piskarov - If you want to try it out, it's at https://github.com/leeksoup/flexible_permissions on the use-core-variationcache branch.

  • Status changed to Needs review 4 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7
    last update 4 months ago
    Patch Failed to Apply
  • 🇮🇳India ameymudras

    @kristiaanvandeneynde even though this module is compatible with the core variation cache the composer.json has a dependency "drupal/variationcache": "^1.0" which prevents removing the contrib variation cache module. I have submitted a small patch to remove the dependency.

  • Status changed to Closed: won't fix 4 months ago
  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    This module still requires VariationCache because we're using those namespaces. We can't change them without it being a BC break. So for now there is nothing to fix. As mentioned in #4 VC had a release that uses core's classes if you're on D10.2

    Please stop reopening this issue and especially with patches that have nothing to do with the issue at all. You've posted a patch for core's SystemAdminMenuBlockAccessCheck

  • 🇮🇳India ameymudras

    Apologies, i submitted a wrong patch. I wanted to submit a patch just to remove composer dependency which was preventing contrib variation cache to be removed from the project. Il be more careful henceforth. thanks

  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    Yeah no worries. I know I wrote in the VC release notes that you can remove the module once you checked the namespaces in your own code, but with contributed modules it's not as easy as we have to maintain BC.

Production build 0.69.0 2024