mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Fix thesaurus regression from f25bdf4171
- Field class is now immutable, mergeWith() returns a new instance - Thesaurus roots are recursively merged - In case of field merge, Structure class do not index the previous field - Added failing test case for previous bugs - Added merge tests on Field class - Added tests for all indexed stuff inside Structure class
This commit is contained in:
@@ -12,7 +12,6 @@ class Structure
|
||||
private $thesaurus_fields = array();
|
||||
private $private = array();
|
||||
private $facets = array();
|
||||
private $aliases = array();
|
||||
|
||||
/**
|
||||
* @param \databox[] $databoxes
|
||||
@@ -34,10 +33,9 @@ class Structure
|
||||
{
|
||||
$name = $field->getName();
|
||||
if (isset($this->fields[$name])) {
|
||||
$this->fields[$name]->mergeWith($field);
|
||||
} else {
|
||||
$this->fields[$name] = $field;
|
||||
$field = $this->fields[$name]->mergeWith($field);
|
||||
}
|
||||
$this->fields[$name] = $field;
|
||||
|
||||
if ($field->getType() === Mapping::TYPE_DATE) {
|
||||
$this->date_fields[$name] = $field;
|
||||
|
Reference in New Issue
Block a user