Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Testcase for broken (?) Schema::hash() #105

Closed

Conversation

bjornpost
Copy link
Collaborator

I couldn't reproduce with the Hero/SecretIdentity example DomainObjects, so I've simplified the models which trigger the issue in our project and included them here (PHP 5.4 only, so this testcase might fail on 5.3).

Differences between Hero/SecretIdentity and Veldwerkdag/Project are the definition of the primary key (Sequence vs. Integer) and in the belongsTo relationship we define both local and foreign keys.

Please var_dump($schema->hash($object, array($this->local))) in Relationships/BelongsTo.php to see the issue. (Not sure how I could let the test fail on this)

@bjornpost
Copy link
Collaborator Author

@lox Are you able to reproduce the issue I'm seeing with this testcase?

@bjornpost
Copy link
Collaborator Author

ping @lox

@lox lox added this to the 1.3.0 milestone Apr 18, 2014
@lox lox closed this in 09170b1 Apr 18, 2014
@bjornpost
Copy link
Collaborator Author

Thanks! 👍

@bjornpost
Copy link
Collaborator Author

Hmm, @lox, can you reopen this? Seems like the issue isn't fixed:

Questionnaire -- belongsTo (projectID, id) --> Project

Pheasant checks for Model\Project[id=x] in the cache. The key (id) is correct, but the value it checks for not. x is not the foreign value, but the local value.

For HasOne relationships the symptoms are exactly the other way around. The value it checks for is correct, but the key is not.

@bjornpost bjornpost deleted the testcase-for-broken-schema-hash branch April 19, 2014 15:27
@bjornpost bjornpost mentioned this pull request Apr 29, 2014
@lox
Copy link
Owner

lox commented Apr 30, 2014

I don't know why, but I can't seem to re-open this. Strange.

@harto
Copy link
Collaborator

harto commented May 5, 2014

See #109 instead. /cc @lox @bjornpost

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

Successfully merging this pull request may close these issues.

None yet

3 participants