Commit 5585e8e1 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix creation of agents without names

parent f135a1cc
Pipeline #11740 passed with stages
in 5 minutes and 5 seconds
......@@ -35,7 +35,7 @@ dependencies {
// https://mvnrepository.com/artifact/org.elasticsearch.client/elasticsearch-rest-high-level-client
//compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: '7.1.0'
implementation 'org.memobase:memobase-service-utilities:1.4.1'
implementation 'org.memobase:memobase-service-utilities:1.5.0'
// Logging Framework
implementation "org.apache.logging.log4j:log4j-api:${log4jV}"
......
......@@ -28,6 +28,7 @@ class AgentFieldMapper : TypeFieldMapper() {
if (properties.size > 0) {
val relationNameField = properties.filter { it.first == KEYS.relationName }
val otherFields = properties.filterNot { it.first == KEYS.relationName }
if (otherFields.isNotEmpty()) {
if (relationNameField.isEmpty() && KEYS.agentPropertiesMap.containsKey(sourceKey)) {
subject.addAgent(sourceKey, agentClassType, otherFields)
} else {
......@@ -36,4 +37,5 @@ class AgentFieldMapper : TypeFieldMapper() {
}
}
}
}
}
\ No newline at end of file
......@@ -3,18 +3,22 @@ record:
type:
const: Foto
creators:
person:
- person:
relationName:
const: Fotograf
name: fotograf
corporateBody:
- corporateBody:
relationName:
de: atelier_relation
name: atelier
agent:
- agent:
relationName:
de: Agent
name: agent
- person:
relationName:
const: NoValue
name: no_value
contributors:
person:
relationName:
......
Supports Markdown
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