-
Notifications
You must be signed in to change notification settings - Fork 820
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
FIX: Duplicating many_many relationships looses the extra fields (fixes #7973) #8009
FIX: Duplicating many_many relationships looses the extra fields (fixes #7973) #8009
Conversation
This needs to go into 3, I'm afraid |
If you can find a way of patching |
I reckon you can add a new condition to
|
Ya that would make sense, let me give it a shot and I'll update in a bit. |
@dhensby There hows that look? Also should we back port this to 3.5 too or just for 3.6 and another solution for 4.0? |
Not sure why the PGSQL test failed... it should have worked my local copy with postgres 9.3 and SilverStripe 3.6.5 :S passed |
@UndefinedOffset Try adding a sort, I seem to remember PostgreSQL having issues with inconsistent result ordering if you don’t provide one... |
It looks good to me, let's rebase onto 3.5 :) |
Will do and I have a branch for 4.0 I'll open a pull for that too https://github.com/webbuilders-group/silverstripe-framework/tree/duplicate-many-many-fix-4-0 |
FIX Regression from #8009
Fixes issue when you duplicate a DataObject with a many_many relationship with extra fields defined for the relationship extra fields are lost due to how DataObject::duplicateManyManyRelations() and DataObject::duplicateRelations() function. In short when the new items are added to the many_many relationship the extra fields are not included or even retrieved when DataObject::duplicateRelations() adds the item to the list. This issue also seems to affect 4.0 but the fix required would be slightly different see #7973 for details.