invalidateAll() is depriated on CacheBackendInterface

Created on 28 April 2025, 1 day ago

Problem/Motivation

Great progress has been made fixing code quality issues on this module.

However, there is still one issue reported for phpstan (next minor), reported as follows:

 ------ ---------------------------------------------------------------- 
  Line   src/Form/AbrconfigDeleteForm.php                                
 ------ ---------------------------------------------------------------- 
  64     Call to deprecated method invalidateAll() of interface          
         Drupal\Core\Cache\CacheBackendInterface:                        
         in drupal:11.2.0 and is removed from drupal:12.0.0. Use         
           CacheBackendInterface::deleteAll() or cache tag invalidation  
         instead.                                                        
         ๐Ÿชช  method.deprecated                                           
 ------ ---------------------------------------------------------------- 
 ------ ---------------------------------------------------------------- 
  Line   src/Form/AbrconfigForm.php                                      
 ------ ---------------------------------------------------------------- 
  308    Call to deprecated method invalidateAll() of interface          
         Drupal\Core\Cache\CacheBackendInterface:                        
         in drupal:11.2.0 and is removed from drupal:12.0.0. Use         
           CacheBackendInterface::deleteAll() or cache tag invalidation  
         instead.                                                        
         ๐Ÿชช  method.deprecated                                           
 ------ ---------------------------------------------------------------- 
 [ERROR] Found 2 errors   

Steps to reproduce

View on pipeline: https://git.drupalcode.org/project/access_by_ref/-/jobs/5068303

Proposed resolution

It would be interesting to see if this could be resolved through tag invalidation, but I don't think that is possible, since adding or deleting an ABR entity changes visibility of content, so a rebuild of the render cache is required.

Fixing this should simply be a matter of changing invalidateAll() calls to deleteAll().

This would be a good task for a novice developer.

Remaining tasks

  • In src/Form/AbrconfigDeleteForm.php, change $this->cacheRenderer->invalidateAll(); to $this->cacheRenderer->deleteAll();
  • in src/Form/AbrconfigForm.php, change $this->cacheRenderer->invalidateAll(); to $this->cacheRenderer->deleteAll();

User interface changes

None.

API changes

None.

Data model changes

None.

๐Ÿ“Œ Task
Status

Active

Version

4.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024