diff --git a/CHANGELOG.md b/CHANGELOG.md index cac4328086b13487cbc82f0535a0a655d8fa69cb..94ee392ace24eadf83aab738dcfd5688060e268e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Version 1.0.2 + +* Fixed bug #11 (Fatal error clone on non object) + # Version 1.0.1 Initial release. \ No newline at end of file diff --git a/Civi/DataProcessor/FilterHandler/AbstractFieldFilterHandler.php b/Civi/DataProcessor/FilterHandler/AbstractFieldFilterHandler.php index b30570257155959a256178ed4935fc7844b111ce..8e118988695bec1fb5967d24a4076dc54b4777d2 100644 --- a/Civi/DataProcessor/FilterHandler/AbstractFieldFilterHandler.php +++ b/Civi/DataProcessor/FilterHandler/AbstractFieldFilterHandler.php @@ -39,6 +39,13 @@ abstract class AbstractFieldFilterHandler extends AbstractFilterHandler { if (!$this->dataSource) { throw new DataSourceNotFoundException(E::ts("Filter %1 requires data source '%2' which could not be found. Did you rename or deleted the data source?", array(1=>$this->title, 2=>$datasource_name))); } + if (!$this->dataSource->getAvailableFilterFields()->getFieldSpecificationByName($field_name)) { + throw new FieldNotFoundException(E::ts("Filter %1 requires a field with the name '%2' in the data source '%3'. Did you change the data source type?", array( + 1 => $this->title, + 2 => $field_name, + 3 => $datasource_name + ))); + } $this->fieldSpecification = clone $this->dataSource->getAvailableFilterFields()->getFieldSpecificationByName($field_name); if (!$this->fieldSpecification) { throw new FieldNotFoundException(E::ts("Filter %1 requires a field with the name '%2' in the data source '%3'. Did you change the data source type?", array(