'0' value in custom field is treated as a change

Hello,

I’m trying to get going RT’s asset system on 4.4.1, and I ran into an odd issue. At first it seemed to be related to import, but it seems to affect all custom fields in RT.

Simply put: if a custom field contains value ‘0’ (without quotes) then selecting ’save asset’ or ’save changes’ will always record this as a change.

Eg:

enter 12, hit save
• BuildingAccess 1 changed to 12
enter 5, hit save
• BuildingAccess 12 changed to 5
hit save - nothing

enter 0, hit save
• BuildingAccess 5 changed to 0
hit save:
• BuildingAccess 0 changed to 0
hit save:
• BuildingAccess 0 changed to 0

rinse & repeat.

This was tested with ‘Enter one value’ type. I don’t suppose that’s normal, is it?

Couple additional notes:

  1. Seems this issue was also present in 4.2.x (per third party test results)
  2. This also persists when repeatedly importing assets via rt-assets-import-csv --update

Hi Dominik,

Sorry about the noise in your transaction log. You’re right that it affects 4.2; versions since 4.2.9 have this bug. We’ve fixed this in 4.2-trunk, which will become RT 4.2.14.

If you could give this patch a try, please let us know how it goes :slight_smile:

Best,
Shawn

Can this be applied to 4.4.1? That’s what I’m currently running. I added the note about 4.2.x tree, because I was able to have somebody else verify that this issue exists there too.

Yes you can apply it to 4.4.1. The patch applies nearly perfectly, with “Hunk #2 succeeded at 147 (offset 1 line).” which you can ignore (though it will create a lib/RT/ObjectCustomFieldValues.pm.orig that you can delete)

Thanks! Patch applied and tested, seems to fix the problem.