Skip to content

fix(schema): declare InternalFile.metaData.creator_id as a user reference #18206

Description

Sub-issue of #18201.

The user merge cannot discover this field from the schema, so it is declared by hand in USER_MERGE_SCALAR_COMPLEMENTS (src/modules/userMerge/userMerge-scalarRules.ts), under the id internal-file-metadata-creator-id.

Current declarationsrc/modules/internal/document/document.ts:45

{ name: 'creator_id', label: 'Related creator', type: 'string', format: 'short', mandatoryType: 'internal', editDefault: false, multiple: false, upsert: true, isFilterable: true },

held under the metaData parent, src/modules/internal/document/document.ts:26

{ name: 'metaData', label: 'File metadata', type: 'object', format: 'standard', ... }

What is missing: two things, and both need checking. The child is declared with format: 'short' rather than as a user reference; and the parent is format: 'standard' rather than 'nested', so the discovery does not walk into it. Fixing the child alone may not be enough.

Expected: declare the child as a user reference, i.e. format: 'id' with entityTypes: [ENTITY_TYPE_USER], and make the discovery reach it.

Done when: the declaration is fixed, the matching entry is removed from USER_MERGE_SCALAR_COMPLEMENTS, and tests/01-unit/modules/userMerge/userMerge-schemaDiscovery-test.ts passes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugType: something isn't working (fix:).

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions