-
Notifications
You must be signed in to change notification settings - Fork 28
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
[BUGFIX] Fix SubscriberList to Subscriber relationship definition by … #312
base: main
Are you sure you want to change the base?
[BUGFIX] Fix SubscriberList to Subscriber relationship definition by … #312
Conversation
…adding changing invertedBy to mappedBy in Subscriber
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Would you mind adding the schema validation as a kind of regression test for this?
…escription in the contribution document.
@oliverklee I have added the check but it looks like fixing the validation does not fix all problems. For some reasons doctrine still thinks there is a problem. I think it is the double mapping configuration of the many to many bidirectional relation between SubscriberList and Subscriber. I am surprised this was never seen before. The nicest approach for the project with version 4 is difficult to achieve without automation, ie
As you can see the test is failing. I might check later if I can find a way to make the message |
https://github.com/phpList/core/blob/master/src/Domain/Model/Subscription/Subscription.php#L23 and https://github.com/phpList/core/blob/master/src/Domain/Model/Messaging/SubscriberList.php#L118 Are conflicting with each other. The table cannot exist for and entity and at the same time as a many to many mapping. Not sure which one to remove. Also given the integration tests are broken it is also not obvious what to do. |
In that case, the m:n mapping should be removed (i.e., it should then go through the other model). (I'd like it more though if we could have both.)
AFAICT, the tests still are green. Or am I missing something here? |
That is because currently the phpList 4 core is expected to use an existing phpList 3 database, not create a new database from scratch. (That will come later when phpList 4 is feature-complete enough to be used without phpList 3.) |
@bizmate By the way, thank you for contributing! I really appreciate your efforts. ❤️ |
@oliverklee sorry I was not able to move this further. I wanted to run the travis commands/CI locally and given the repo does not have built in way to do it automatically i was spending time to work how to run the tests correctly on my local machine as I think this might be the reason why I get the errors in the tests. I will try to spend sometime on it ASAP |
…adding changing invertedBy to mappedBy in Subscriber
Summary
Doctrine bidirectional many to many relationship requires an
invertedBy
mapping and amappedBy
one.Fixes validation error as per issue #311