Patch #32977
Remove references to deleted user from "user"-Format CustomFields
Status: | New | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Custom fields | |||
Target version: | 4.2.0 |
Description
When a user record is destroyed, custom field values for custom fields with field_format == 'user'
referencing the destroyed user are left unchanged.
This leads to problems with queries on such a custom field when using either the none
or any
operators, since these match against custom_values.value
(not) being null
or ''
- records that have the destroyed user's ID set will not turn up in the none
query, but in the any
query, despite being displayed with an empty value in the UI.
The attached patch adds a test case and addresses the issue by removing custom_values
records that reference the destroyed user.
History
#2
Updated by Marius BALTEANU 11 months ago
We shouldn't add a migration to remove the existing orphaned values?
#3
Updated by Jens Krämer 11 months ago
we should indeed do that. I'll take care of that tomorrow.
#4
Updated by Jens Krämer 11 months ago
here's a new patch including a migration to delete already existing orphaned values.