-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TaxonomyField update shouldn't use the database unless necessary #8704
Comments
I'll do a bit of a stream of consciousness as I try to remember how Those IDs (for the terms selected in a
It's possible that one way to fix this would be to make the |
I wasn't really considering versioning, but I agree that it's weird that saving a draft item with different terms selected is immediately reflected in the published version as well. My immediate concern here is that DB changes happen even when they aren't needed: When you save a Taxonomy Field without changes, the DB operations play out as if you unselected all the terms, saved it and then re-selected the same terms and saved it again, which is wasteful. |
Yes. On the other hand, if we moved to a versioned record, that's sort of the default behaviour: the records for the new version, if no change has happened, end up being duplicates of the previous ones (except for the relevant Ids). But we would not be deleting a record just to add it back. |
When a content item is saved that has
TaxonomyField
s,TaxonomyFieldDriver
will callTaxonomyFieldService.UpdateTerms
(unless there's a validation error). In that function, all the TermContentItem entries associated with the field are dropped and then new ones are created based on the Terms selected in the editor. However, this happens even if the selected term(s) didn't change.Suggested changes:
What do you think? CC: @MatteoPiovanelli-Laser @sebastienros
The text was updated successfully, but these errors were encountered: