Fix custom object renaming (#8746)

Currently when renaming an object, we execute
```
await this.fieldMetadataRepository
                    .findOneByOrFail({
                      name: existingObjectMetadata.nameSingular,
                      label: existingObjectMetadata.labelSingular,
                      objectMetadataId: relatedObject.id,
                      workspaceId: workspaceId,
                    })
```
to find the standard relation fields. 
This would throw an error if the label solely was update beforehand
without updating the name too: in that case we will not have migrated
the label of the standard relation fields (which is maybe a mistake?
@Weiko wdyt?).
Let's remove it.
This commit is contained in:
Marie
2024-11-26 11:01:12 +01:00
committed by GitHub
parent a026cde46a
commit 4c413d4802

View File

@ -165,12 +165,11 @@ export class ObjectMetadataMigrationService {
});
if (relatedObject) {
// 1. Update to and from relation fieldMetadata)
// 1. Update to and from relation fieldMetadata
const toFieldRelationFieldMetadataId =
await this.fieldMetadataRepository
.findOneByOrFail({
name: existingObjectMetadata.nameSingular,
label: existingObjectMetadata.labelSingular,
objectMetadataId: relatedObject.id,
workspaceId: workspaceId,
})