Commit df48b5fe authored by jaapjansma's avatar jaapjansma

try out fix for issue #31

parent a73f925b
......@@ -64,7 +64,7 @@ class CRM_Dataprocessor_BAO_DataProcessor extends CRM_Dataprocessor_DAO_DataProc
$cache = CRM_Dataprocessor_Utils_Cache::singleton();
if (!$force && $dataProcessorClass = $cache->get($cache_key)) {
// Reset the default filter values as they might have been changed.
$dataProcessorClass->setDefaultFilterValues();
$dataProcessorClass->loadedFromCache();
return $dataProcessorClass;
}
$factory = dataprocessor_get_factory();
......
......@@ -181,11 +181,17 @@ abstract class AbstractProcessorType {
}
/**
* Sets the default filter values for all filters.
* Sets the default filter values for all filters and calls loadFromCache on a source.
*
* @throws \Exception
*/
public function setDefaultFilterValues() {
public function loadedFromCache() {
if ($this->dataSources && is_array($this->dataSources)) {
foreach ($this->dataSources as $dataSource) {
$dataSource->sourceLoadedFromCache();
}
}
if ($this->filterHandlers && is_array($this->filterHandlers)) {
foreach ($this->filterHandlers as $filterHandler) {
$filterHandler->setDefaultFilterValues();
......
......@@ -297,4 +297,12 @@ abstract class AbstractSource implements SourceInterface {
return $configuration;
}
/**
* This function is called after a source is loaded from the cache.
* @return void
*/
public function sourceLoadedFromCache() {
}
}
......@@ -93,4 +93,15 @@ class ACLContactSource extends ContactSource {
}
}
/**
* This function is called after a source is loaded from the cache.
* @return void
*/
public function sourceLoadedFromCache() {
// reset the source. This completly looks up all the custom fields etc.. of this source
// ideally we only want to reset the aclWherePart.
$this->reset();
$this->initialize();
}
}
......@@ -139,4 +139,10 @@ interface SourceInterface {
*/
public function processConfiguration($submittedValues);
/**
* This function is called after a source is loaded from the cache.
* @return void
*/
public function sourceLoadedFromCache();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment