General error message when copying text field with PrependCopyText in production environment

I was trying to copy an entity row via Origam copy functionality.

I was expecting to get a copy or at least a user readable error message

Instead I’ve got a general error message without any details

Error is being able to replicate in 2024-9 (where I hit into it) and in master as well.

How to replicate:

  1. Make sure production enviromnet is set (not development), so that no tracebacks are shown to the end user
  2. checkout origam/origam at branch error-when-copying-text-field-with-PrependCopyTest
  3. open Menu > Widgets > AllDataTypes screen
  4. create a new row with random values. Make only sure the Text1 field is filled with 50 chars (max value)
  5. save the row
  6. click on the copy icon. The error will appear.

I, as a user, expect that everything is copied, or I am notified it is not possible due to max field length limitation. So the new solution cut a message without notifying me. It can be a large form and I might not notice it.

My opinion is that a typical use case of “Copy - xxxx” usage is for a field that identifies the record. That means the user always decides on what the text is and it most probably totally differs from the original “Copy of xxx” text. So I don’t think the user could make a mistake. They will change the whole text anyway.

In any case the root cause of the problem is that the field is too short. The user should never get to the point of having the text cut off even when “Copy” text is prepended. If it happens, the field length should be increased.