Custom object key value cached(?), has to be changed manually

  • Used Zammad version: 6.0.0-1689692060.509a4e6a.jammy
  • Used Zammad installation type: package
  • Operating system: win 10
  • Browser + version: Chrome, Brave latest

Expected behavior:

I have created an object for users, a single selection field. This object has a key and display names, and is used to populate text in the text modules, a la “Dear Mr” or “Dear Mrs” depending on what is selected in that object.

I had initially made a typo in that object, assigned values to that object on a couple of users, noticed the mistake and corrected the key of the object.

I expected the key value to change for the users, so that when I reference it with #{ticket.created_by.anrede2}, the value that gets pulled from the object is the new, corrected version.

Actual behavior:

I get the old wrong key value with a typo, before I corrected it.
It is enough to open the user, and then to assign him the same value in the dropdown again, and the key_value pulled by #{ticket.created_by.anrede2} will be correct.

Steps to reproduce the behavior:

Create a new object for a user, single-selection field.
Populate it with choices, reference the object in a text module. Set the object to the desired choice for the desired user.

Use the text module in a ticket reply. As expected, the object key value is used.

Edit the key value of the object.

Use the text module in a ticket reply. The old, unedited value of the object key is used.

Zammad does not automatically update default values (or generally changed values) from existing datasets. This is by design.

If you have to, you can adjust the value with the following command in the rails console. However note that this potentially causes a high amount of delayed jobs and thus performance issues depending on the moment you run it. This change is final and cannot be undone, have a backup ready.

Dangerzone
Ticket.where(anrede: 'faultyvalue').find_in_batches.each do |t|
   t.update(anrede: 'newvalue')
end

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.