Patch #32977

Remove references to deleted user from "user"-Format CustomFields

Added by Jens Krämer 17 days ago. Updated 9 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:


Category:Custom fields
Target version:4.2.0


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.

0001-removes-references-to-deleted-users-in-custom-field-.patch Magnifier (2.71 KB) Jens Krämer, 2020-02-10 10:09

0001-removes-references-to-deleted-users-in-custom-field-.patch Magnifier - updated patch including migration (3.65 KB) Jens Krämer, 2020-02-11 06:29


#1 Updated by Go MAEDA 17 days ago

  • Target version set to Candidate for next minor release

#2 Updated by Marius BALTEANU 17 days ago

We shouldn't add a migration to remove the existing orphaned values?

#3 Updated by Jens Krämer 17 days ago

we should indeed do that. I'll take care of that tomorrow.

#4 Updated by Jens Krämer 16 days ago

here's a new patch including a migration to delete already existing orphaned values.

#5 Updated by Go MAEDA 16 days ago

  • Target version changed from Candidate for next minor release to Candidate for next major release

The patch cannot be committed for minor releases because it has a migration.

#6 Updated by Go MAEDA 9 days ago

  • Assignee set to Jean-Philippe Lang
  • Target version changed from Candidate for next major release to 4.2.0

Setting the target version to 4.2.0.

Also available in: Atom PDF