Skip to content

Commit

Permalink
Fixed Favourite Parameters in Symfony 3.4 and Ibexa Platform 2.5
Browse files Browse the repository at this point in the history
PHP:

- FavouritesParamCoordinator.php: Enforced overwriting the cached favourites when removing or saving new favourites (again the Symfony cache did not successfully detect that its item had been deleted)

- LocationRetrievalCoordinator.php: Removed unnecessary documentation parts
  • Loading branch information
JAC - Frederic Bauer committed Dec 15, 2020
1 parent 418d8d6 commit d4288bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/ConfigProcessorBundle/FavouritesParamCoordinator.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ function() use ($favouriteRetrievalProcessor, $processedParameters) {

if (count($uncommonFavourites[0]) > 0) {
self::$cache->deleteItem("cjw_custom_favourite_parameters");
Utility::cacheContractGetOrSet("cjw_custom_favourite_parameters", self::$cache,
Utility::cacheContractGetOrSet(
"cjw_custom_favourite_parameters",
self::$cache,
function() use ($previousFavourites, $newFavourites) {
return array_replace_recursive($previousFavourites, $newFavourites);
}
},
true
);
}
}
Expand Down Expand Up @@ -158,10 +161,13 @@ function() use ($favouriteRetrievalProcessor, $processedParameters) {
if (count($uncommonFavourites[1]) > 0) {
self::$cache->deleteItem("cjw_custom_favourite_parameters");

Utility::cacheContractGetOrSet("cjw_custom_favourite_parameters", self::$cache,
Utility::cacheContractGetOrSet(
"cjw_custom_favourite_parameters",
self::$cache,
function () use ($currentFavourites) {
return $currentFavourites;
}
},
true
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class LocationRetrievalCoordinator
/** @var array An array which not only stores the parameters, but also the paths they have been read from (including the values set there) */
public static $parametersAndLocations;

/** @var PhpFilesAdapter A cache which is supposed to store the parameters that have been parsed. */
/** @var PhpFilesAdapter A cache which is supposed to store parameters that have been parsed. */
private static $cache;

/** @var bool */
Expand Down

0 comments on commit d4288bc

Please sign in to comment.