[SOLVED] max length limited to 30 chars for a text field in Queue Preferences

Moderator: crythias

Post Reply
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

[SOLVED] max length limited to 30 chars for a text field in Queue Preferences

Post by Giulio Soleni »

Hello,
I am testing a new installation of OTRS 5.
I would like to add an input text field to the Queue definition menu (AdminQueue) to specify some administrative information.
Therefore I add the new file:
/opt/otrs/Kernel/Config/Files/QueueCustomerOrder.xml

with the following content:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<otrs_config version="1.0" init="Framework">
<ConfigItem Name="QueuePreferences###CustomerOrderField" Required="0" Valid="1">
        <Description Translatable="1">Defines Customer Order field for queue.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Queue::Preferences</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::QueuePreferences::Generic</Item>
                <Item Key="Label" Translatable="1">Customer Order</Item>
                <Item Key="PrefKey">OrderId</Item>
                <Item Key="Block">Input</Item>
                <Item Key="MaxLength">40</Item>
                <Item Key="Prio">6101</Item>
                <Item Key="Active">1</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
and after a config rebuild I got the desired field...
however the max length of string I can put within that field is limited to 30 characters.
There should be a default configured somewhere but I was not able to find it out...
On the other hand it's clear that the statement <Item Key="MaxLength">40</Item> has no result.

Since the codes I have to put within that new fields are up to 40 chars I need to extend it to that length... do you know if there is a way to set this cap value within the xml configuration file?

(By the way, I would like to avoid the use of TextArea fields if possible)

thank you very much in advance!
Giulio
Last edited by Giulio Soleni on 02 Apr 2016, 19:26, edited 1 time in total.
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: max length limited to 30 chars for a text field in Queue Preferences

Post by Giulio Soleni »

...any hint?
I am digging through the code but I could not find anything useful so far...

thank you

EDIT: Found!
on /opt/otrs/Kernel/Output/HTML/Templates/Standard/AdminQueue.tt
at the bottom of the file there are the blocks with the specifics for any kind of queue preferences field;

Code: Select all

[% RenderBlockStart("Input") %]
                        <label for="[% Data.Name | html %]">[% Translate(Data.Label) | html %]:</label>
                        <div class="Field">
                            <input type="text" name="[% Data.Name | html %]" id="[% Data.Name | html %]" value="[% Data.SelectedID | html %]" class="W50pc" maxlength="30"/>
                            <p class="FieldExplanation">
                                [% Translate(Data.Desc) | html %]
                            </p>
                        </div>
                        <div class="Clear"></div>
[% RenderBlockEnd("Input") %]
I just changed maxlength="30" to maxlength="40" (my needs).
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
Post Reply