Project

General

Profile

Actions

Bug #16204

closed

TypeAhead Prefetch Expects String Array Given

Added by Pascal Rössler about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Carsten Rose
Target version:
Start date:
12.05.2023
Due date:
% Done:

0%

Estimated time:
Discuss:
Prio Planung:
No
Vote:

Description

maxLength is automatically set based on the column type maxlength of the database.
addding a check if a typeahead is set resolves this issue.

if ($this->maxLength > 0 && $this->value !== '') {
    // Check if there are \r\n > those should be counted as one char, not two. #13030
    $crlf = substr_count($this->value, "\r\n");
    $max = $this->maxLength + $crlf;
    // crop string only if it's not empty (substr returns false on empty strings)
    $this->value = mb_substr($this->value, 0, $max);
}

Actions

Also available in: Atom PDF