mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-26 09:22:14 +00:00
* Fix #13982: Fix userFQN encoding while creating mentions * quote only teams or users
This commit is contained in:
parent
e98ae8aa2a
commit
4b7f4f43d6
@ -0,0 +1,3 @@
|
||||
update field_relationship fr INNER JOIN user_entity ue on fr.fromFQN=ue.name
|
||||
set fr.fromFQNHASH=MD5(JSON_UNQUOTE(JSON_EXTRACT(ue.json, '$.fullyQualifiedName'))),
|
||||
fr.fromFQN=JSON_UNQUOTE(JSON_EXTRACT(ue.json, '$.fullyQualifiedName')) where fr.fromType='user';
|
@ -0,0 +1,3 @@
|
||||
update field_relationship fr
|
||||
set fromFQNHASH=MD5(ue.json->>'fullyQualifiedName'),
|
||||
fromFQN=ue.json->>'fullyQualifiedName' from user_entity ue where fr.fromType='user' and fr.fromFQN=ue.name;
|
@ -23,6 +23,8 @@ import java.util.regex.Pattern;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openmetadata.service.Entity;
|
||||
import org.openmetadata.service.util.FullyQualifiedName;
|
||||
|
||||
@Slf4j
|
||||
public final class MessageParser {
|
||||
@ -167,18 +169,19 @@ public final class MessageParser {
|
||||
EntityLink entityLink = null;
|
||||
while (matcher.find()) {
|
||||
if (entityLink == null) {
|
||||
String entityType = matcher.group(1);
|
||||
String entityFQN = matcher.group(2);
|
||||
if (entityFQN == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid Entity Link. Entity FQN is missing in " + link);
|
||||
}
|
||||
if (entityType.equalsIgnoreCase(Entity.USER)
|
||||
|| entityType.equalsIgnoreCase(Entity.TEAM)) {
|
||||
entityFQN = FullyQualifiedName.quoteName(entityFQN);
|
||||
}
|
||||
entityLink =
|
||||
new EntityLink(
|
||||
matcher.group(1),
|
||||
entityFQN,
|
||||
matcher.group(4),
|
||||
matcher.group(6),
|
||||
matcher.group(8));
|
||||
entityType, entityFQN, matcher.group(4), matcher.group(6), matcher.group(8));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unexpected multiple entity links in " + link);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user