8000 Allow empty string identifiers by Ocramius · Pull Request #5924 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow empty string identifiers #5924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Ocramius
Copy link
Member
@Ocramius Ocramius commented Jul 7, 2016

This PR fixes a subtle bug that disallowed the UnitOfWork from containing entities with a '' identifier.

Note: this fix targets ORM 2.6, because empty identifiers are still subject to bug #5923

@Ocramius Ocramius added the Bug label Jul 7, 2016
@Ocramius Ocramius added this to the 2.6.0 milestone Jul 7, 2016
Ocramius added 4 commits July 7, 2016 20:39
…ed identifiers

Background:

Test relied on an `A->B->C` association:

 * `A#id` being `B`
 * `B#id` being `C`
 * `C#id` being an auto-generated identifier (post-insert)

This cannot work, because it breaks the UnitOfWork's identity map.
Specifically, no entries for `A` and `B` can exist in the identity map until `C` entries
are persisted (post-insert).

That means that the identifier generator for `A` and `B` should not be an "assigned"
generator, but should instead be a post-insert generator waiting for other entities
to be persisted.

We cannot fix this in ORM 2.x, but we'll need to invent something for 3.x in order to
fix that (directed graph, or caching the order of operations in the metadata graph).
@deeky666 deeky666 merged commit 355d2c3 into master Jul 7, 2016
@deeky666
Copy link
Member
deeky666 commented Jul 7, 2016

hiding

@Ocramius Ocramius deleted the fix/allow-empty-identifier-string-as-proxy-identifier branch July 7, 2016 21:12
@Ocramius
Copy link
Member Author
Ocramius commented Jul 7, 2016

@deeky666 thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0