diff --git a/databox/api/src/Api/Provider/FieldTypeProvider.php b/databox/api/src/Api/Provider/FieldTypeProvider.php index 2e5e176be..b0ae5e8f3 100644 --- a/databox/api/src/Api/Provider/FieldTypeProvider.php +++ b/databox/api/src/Api/Provider/FieldTypeProvider.php @@ -30,7 +30,7 @@ protected function provideCollection( $t->setName($name); return $t; - }, $this->attributeTypeRegistry->getTypes()); + }, array_filter($this->attributeTypeRegistry->getTypes(), fn (AttributeTypeInterface $type): bool => $type->isListed())); usort($results, fn (FieldType $a, FieldType $b): int => $a->getTitle() <=> $b->getTitle()); diff --git a/databox/api/src/Attribute/Type/AbstractAttributeType.php b/databox/api/src/Attribute/Type/AbstractAttributeType.php index bf4865e39..237ed17fb 100644 --- a/databox/api/src/Attribute/Type/AbstractAttributeType.php +++ b/databox/api/src/Attribute/Type/AbstractAttributeType.php @@ -114,4 +114,9 @@ public function supportsElasticSearchFuzziness(): bool { return false; } + + public function isListed(): bool + { + return true; + } } diff --git a/databox/api/src/Attribute/Type/AttributeTypeInterface.php b/databox/api/src/Attribute/Type/AttributeTypeInterface.php index b10f1f2ba..3062c001b 100644 --- a/databox/api/src/Attribute/Type/AttributeTypeInterface.php +++ b/databox/api/src/Attribute/Type/AttributeTypeInterface.php @@ -70,4 +70,6 @@ public function validate($value, ExecutionContextInterface $context): void; public function getAggregationField(): ?string; public function normalizeBucket(array $bucket): ?array; + + public function isListed(): bool; } diff --git a/databox/api/src/Attribute/Type/CollectionPathAttributeType.php b/databox/api/src/Attribute/Type/CollectionPathAttributeType.php index 1dae47a5f..cb79a46b4 100644 --- a/databox/api/src/Attribute/Type/CollectionPathAttributeType.php +++ b/databox/api/src/Attribute/Type/CollectionPathAttributeType.php @@ -79,4 +79,9 @@ public function supportsAggregation(): bool { return true; } + + public function isListed(): bool + { + return false; + } } diff --git a/lib/php/es-bundle/Indexer/DependencyStack.php b/lib/php/es-bundle/Indexer/DependencyStack.php index 1cf91eab6..20e2a24f0 100644 --- a/lib/php/es-bundle/Indexer/DependencyStack.php +++ b/lib/php/es-bundle/Indexer/DependencyStack.php @@ -25,7 +25,7 @@ public function __construct( private readonly array $currentBatch, array $previousParents ) { - $this->parents = array_map(fn (string $c): string => ClassUtils::getRealClass($c), $previousParents); + $this->parents = $previousParents; } public function getParents(): array @@ -50,6 +50,7 @@ public function getObjects(): array public function addDependency(string $class, string $id, Operation $operation = Operation::Upsert): self { + $class = ClassUtils::getRealClass($class); if ( (isset($this->parents[$class]) && $this->parents[$class]->has($id)) || $this->isInBatch($class, $id) @@ -90,6 +91,7 @@ private function isInBatch(string $class, string $id): bool public function addParent(string $class, string $id): void { + $class = ClassUtils::getRealClass($class); $this->parents[$class] ??= new EntityGroup(); $this->parents[$class]->add($id); }