Javascript Error

Moderator: crythias

Post Reply
Phoenix78
Znuny newbie
Posts: 5
Joined: 07 Nov 2017, 00:50
Znuny Version: 6.0.4

Javascript Error

Post by Phoenix78 »

Hi,

I got a problem on my OTRS system (otrs-6.0.4-03).
I activated the time-accounted mandatory option, but my users have a JavaScript error when they add a duration...

"An error occured! Please check the browser error log for more details!"

The error :
[ERROR] JavaScriptError: Syntax error, unrecognized expression: label[for=]
in Core.Debug.js:61:13



Someone got an idea how to fix this?
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Javascript Error

Post by jojo »

- any packages installed?
- which browser?
- did you clear all caches (OTRS and Browser)
- also you should upgrade to the latest version due to security and other bugfixes
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Phoenix78
Znuny newbie
Posts: 5
Joined: 07 Nov 2017, 00:50
Znuny Version: 6.0.4

Re: Javascript Error

Post by Phoenix78 »

Thanks for reply.
I found the problem : I modified a line in /opt/otrs/Kernel/Output/HTML/Templates/Standard/AgentTicketActionCommon.tt ...
I need to set minute as time unit, but sometimes accounted time for a note is like 1 month... So I added a dropdown list...

on line 417, I replace
<input type="text" name="TimeUnits" id="TimeUnits" value="[% Data.TimeUnits | html %]" class="W50pc Validate_TimeUnits [% Data.TimeUnitsRequired | html %] [% Data.TimeUnitsInvalid | html %]"/>
with
<input list="TimeUnits" class="W50pc Validate_TimeUnits [% Data.TimeUnitsRequired | html %] [% Data.TimeUnitsInvalid | html %]"/>
<datalist id="TimeUnits">
<option value="60">1 hour</option>
<option value="120">2 hours</option>
...
</datalist>
This can't work?
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Javascript Error

Post by zzz »

Hello,

no, that can't work, as you have noticed already.
You have changed the type of a static field which has a different way of checking values.
You could make the default field invisible, create your custom dropdown, and update its value with an EventListener that listens on changes of your list (basic JavaScript skills needed).

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
Post Reply