Skip to content

fix: remove duplicate Doctrine XML mapping for deprecated PublicKeyCredentialSource#828

Open
yoav-ebp wants to merge 1 commit intoweb-auth:5.3.xfrom
transferfintech:fix/duplicate-mapping-824
Open

fix: remove duplicate Doctrine XML mapping for deprecated PublicKeyCredentialSource#828
yoav-ebp wants to merge 1 commit intoweb-auth:5.3.xfrom
transferfintech:fix/duplicate-mapping-824

Conversation

@yoav-ebp
Copy link
Copy Markdown

Fixes #824

Problem

Since 5.3 (#751), Webauthn\PublicKeyCredentialSource is a deprecation shim that extends Webauthn\CredentialRecord. However, the Symfony bundle still ships PublicKeyCredentialSource.orm.xml alongside CredentialRecord.orm.xml, both declaring the same 13 fields as a <mapped-superclass>.

With Doctrine ORM 3, metadata compilation walks the inheritance chain and picks up identical field definitions from both files, causing:

Duplicate definition of column 'public_key_credential_id' on entity
'Webauthn\PublicKeyCredentialSource' in a field or discriminator column mapping.

Fix

Remove src/symfony/src/Resources/config/doctrine-mapping/PublicKeyCredentialSource.orm.xml.

Concrete entities extending either CredentialRecord or the deprecated PublicKeyCredentialSource continue to inherit the field set through PHP inheritance + CredentialRecord.orm.xml; no downstream mapping is lost.

Diff

Single file removed (22 lines deleted, 0 added).

…edentialSource

Since 5.3 (PR web-auth#751), `Webauthn\PublicKeyCredentialSource` is a deprecation
shim that extends `Webauthn\CredentialRecord`. However, the Symfony bundle
still ships `PublicKeyCredentialSource.orm.xml` alongside `CredentialRecord.orm.xml`,
both declaring the same 13 fields as a `<mapped-superclass>`.

With Doctrine ORM 3, metadata compilation walks the inheritance chain and
picks up identical field definitions from both files, causing:

    Duplicate definition of column 'public_key_credential_id' on entity
    'Webauthn\\PublicKeyCredentialSource' in a field or discriminator column mapping.

Concrete entities extending either `CredentialRecord` or the deprecated
`PublicKeyCredentialSource` continue to inherit the field set through
PHP inheritance + `CredentialRecord.orm.xml`; no downstream mapping is lost.

Fixes web-auth#824
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5.3.x: duplicate Doctrine column mapping when both CredentialRecord and PublicKeyCredentialSource XML mappings are loaded

2 participants