Open link in a new tab

Content

Expand project menu

View differences

### Custom field `Text` is displayed as single line input but allows arbitrary length 

When a user adds a the custom field of the type `text`, and leaves the default values, that field can have arbitrary length. However, the input element is single line.

###
Steps to reproduce

1. Add add a custom field of type `Text` to a work package variant. variant that is of the type Text

2. Enter a very long text longer than 256 characters. in the custom field

3. Save the work package.

4. Observe that the
The text spans multiple lines is displayed in full length in the work package detail view. form, but input changes to single line once clicked

5. 4. Click the field to edit it. The input text is displayed as a single-line field.

6. Open
shown abbreviated in the work package table. The text is displayed in truncated form. list


### What is the buggy behavior?

* Text custom fields allow users The field in its default configuration allows to enter an unlimited number input large amounts of characters, although they are intended for single-line input. text, which it should not if it's meant as a single line field.

* Long text values span multiple lines content is not cut off in the work package detail view. view

* The display and editing behavior is inconsistent. If the field should allow long texts, its input field should be a text area rather than a single line.


### What is the expected behavior?

* Text custom fields have a maximum If it is meant as single line input, it's length of 256 characters.

* Users cannot save text custom field values exceeding 256 characters.

* Existing values exceeding 256 characters remain unchanged and can still
should be displayed. restricted or the content cut off in the work package detail view

* Invalid If it is meant as a long plain text custom field values do not prevent changes with arbitrary length, it should switch to other attributes from being saved.

* Admins can convert text
textarea after a certain threshold


The field should display it's content correctly, either way.

### Background

The
custom fields field "text" uses the same database column as "long text", which has formatting. It is therefore technically possible to enter long plain text fields.

* Converting
content. However, if this should be supported, the work package list and detail form needs amendment.

It is also possible to limit the length of the field, but as there might be installations using it in its current form,
a text custom field migration path might be needed.

### Quick fix?

It might be an easy option
to leave the length restriction untouched but

1. to change the default, which is currently "0" (unlimited) to
a long text field is irreversible sensible value

2. to truncate the display in the the work package detail form, so it does not look broken



### Screenshots

<br>


#### input form:

<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/926771/content"></div><figcaption class="op-uc-figure--description">The default length is 0, which means unlimited</figcaption></figure>

<br>

#### Work package detail view:

###

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/926775/content">

#### Work package detail view in input mode

<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/926778/content"></div><figcaption class="op-uc-figure--description">When clicked, the representation switches back to single line input</figcaption></figure>

#### Work package list

<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/926780/content"></div><figcaption class="op-uc-figure--description">The work package list shows the long plain text truncated</figcaption></figure>

<br>

<br>

<br>

###

### Environment information

This is happening in all environments.

<br>

Back