PrefetchCache: respect CustomVar rendering type

fixes #1257
This commit is contained in:
Thomas Gelf 2017-10-24 11:13:48 +02:00
parent 4be7592cde
commit 11bd7215f5
2 changed files with 15 additions and 0 deletions

View File

@ -23,6 +23,16 @@ before switching to a new version.
however allowed to store invalid single Service Objects with no Host. This is however allowed to store invalid single Service Objects with no Host. This is
now illegal, as it never makes any sense now illegal, as it never makes any sense
1.4.2
-----
### Fixed issues
* You can find issues and feature requests related to this release on our
[roadmap](https://github.com/Icinga/icingaweb2-module-director/milestone/13?closed=1)
### Configuration rendering
* FIX: Caching had an influence on context-specific Custom Variable rendering
when those variables contained macros (#1257)
1.4.1 1.4.1
----- -----
### Fixed issues ### Fixed issues

View File

@ -92,6 +92,7 @@ class PrefetchCache
if (null === $checksum) { if (null === $checksum) {
return $var->toConfigString($renderExpressions); return $var->toConfigString($renderExpressions);
} else { } else {
$checksum .= (int) $renderExpressions;
if (! array_key_exists($checksum, $this->renderedVars)) { if (! array_key_exists($checksum, $this->renderedVars)) {
$this->renderedVars[$checksum] = $var->toConfigString($renderExpressions); $this->renderedVars[$checksum] = $var->toConfigString($renderExpressions);
} }
@ -100,6 +101,10 @@ class PrefetchCache
} }
} }
/**
* @param IcingaObject $object
* @return CustomVariableCache
*/
protected function varsCache(IcingaObject $object) protected function varsCache(IcingaObject $object)
{ {
$key = $object->getShortTableName(); $key = $object->getShortTableName();