Patch #32977

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

Added by Jens Krämer about 1 month ago. Updated about 1 month ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% 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.

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

History

#1 Updated by Go MAEDA about 1 month ago

  • Target version set to Candidate for next minor release

#2 Updated by Marius BALTEANU about 1 month ago

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

#3 Updated by Jens Krämer about 1 month ago

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

#4 Updated by Jens Krämer about 1 month ago

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

#5 Updated by Go MAEDA about 1 month 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 about 1 month 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