Skip to content

Commit

Permalink
Drupal 10.3 testcases added in workflow & fix for missing CACHE_MISS_…
Browse files Browse the repository at this point in the history
…IF_UNCACHEABLE_HTTP_METHOD tag is added (#501)
  • Loading branch information
kedarkhaire authored Oct 1, 2024
1 parent f8e8c85 commit a9b6fcf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
drupal-core:
# Should update the following as the minimum supported version from Drupal.org
- "10.2.x"
- "10.3.x"
instance-type:
- "Edge"
- "X"
Expand Down
1 change: 1 addition & 0 deletions src/Controller/PrepaidBalanceControllerBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ protected function getDataFromCache(EntityInterface $entity, string $suffix, cal
*/
public static function getCacheTags(EntityInterface $entity) {
return [
static::CACHE_MISS,
static::CACHE_PREFIX,
static::getCacheId($entity),
];
Expand Down
6 changes: 6 additions & 0 deletions src/Controller/PrepaidBalanceControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
*/
interface PrepaidBalanceControllerInterface {

/**
* Cache prefix is new 'reserved' cache tag format CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:$suffix,
* if something is tagged with this, it will be a cache miss on POST requests.
*/
const CACHE_MISS = 'CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:form';

/**
* Cache prefix that is used for cache tags for this controller.
*/
Expand Down
1 change: 1 addition & 0 deletions src/Controller/PrepaidBalanceXControllerBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ protected function getDataFromCache(EntityInterface $entity, string $suffix, cal
*/
public static function getCacheTags(EntityInterface $entity) {
return [
static::CACHE_MISS,
static::CACHE_PREFIX,
static::getCacheId($entity),
];
Expand Down
6 changes: 6 additions & 0 deletions src/Controller/PrepaidBalanceXControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
*/
interface PrepaidBalanceXControllerInterface {

/**
* Cache prefix is new 'reserved' cache tag format CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:$suffix,
* if something is tagged with this, it will be a cache miss on POST requests.
*/
const CACHE_MISS = 'CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:form';

/**
* Cache prefix that is used for cache tags for this controller.
*/
Expand Down

0 comments on commit a9b6fcf

Please sign in to comment.