-
Notifications
You must be signed in to change notification settings - Fork 824
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
DBComposite::writeToManipulation() is never called #8800
Comments
This is still a thing. Any plans to fix it? Why is this PR closed #8816 ? |
Not sure why the PR was closed. We can rebase the branch, reopen and retarget the PR I guess. |
I think it was automatically closed when the target branch was deleted |
Probably. GitHub doesn't allow me to reopen it, so it probably needs to be edited first or recreated completely. |
:-) i'm just asking because i have a module with a composite field where this could be really handy |
I recreated it here but looks like it had a failing test: #9182. If someone else wants to recreate the PR and fix it up - or just pinch some of the code - then feel free 🙂 |
This is still broken in Silverstripe 5. |
@kinglozzer i took the liberty to take your PR and fix it |
PR merged. This will be automatically tagged once CI has finished running on the branch. |
Affected Version
4.0.0 - 4.3.0
Description
Noticed this when implementing a custom
DBComposite
field type - before a DataObject is written,DBField::writeToManipulation()
should be called against all database fields, but it isn’t called onDBComposite
fields.Looks like there was a subtle behavioural change in commit 11bbed4.
Before:
silverstripe-framework/ORM/DataObject.php
Lines 1255 to 1263 in f0dd9af
After:
silverstripe-framework/ORM/DataObject.php
Lines 1190 to 1200 in 11bbed4
The config option
'dbOnly'
(since replaced by the bitmaskDataObjectSchema::DB_ONLY
) shouldn’t be set here - as that explicitly excludes “virtual” (i.e. composite) fields.Marking as low impact as the composite values are still saved - by virtue of
DBComposite::setField()
calling$record->setField()
for each of the composite valuesRelated PRs
The text was updated successfully, but these errors were encountered: