Znuny/Znuny LTS is a fork of the ((OTRS)) Community Edition, one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management.
In some cases the widget "Dynamic Fields" or "Dynamic Info" are shown empty.
I have found two causes for the problem. Both problems should be solved by my change.
The variable in the code [% IF !TicketFrontendConfig.DynamicField.empty %] is not always empty.
If you configure a dynamic field in a screen as deactivated, it will occure in the variable TicketFrontendConfig.DynamicField.
The method empty() in the code [% IF !TicketFrontendConfig.DynamicField.empty %] does not return the correct value in older versions of template toolkit.
On CentOS 7, perl v5.16.3, Template Toolkit 2.24, the method TicketFrontendConfig.DynamicField.empty returns "".
On Oracle 9.3, perl v5.32.1, Template Toolkit 3.009, under the same circumstances, the method returns "1".
I tested the following code in AgentTicketPhone.tt on both systems:
[% USE Dumper %]
[% Dumper.dump(TicketFrontendConfig.DynamicField) %]
[% Dumper.dump(TicketFrontendConfig.DynamicField.empty) %]
[% Dumper.dump(Data.DynamicFieldHTML.list.size) %] # my suggestion
I also removed the condition from AgentTicketActionCommon.tt and AgentTicketNoteToLinkedTicket.tt because the dynamic fields are added to these masks through the RenderBlock methods.
I did my best to test all different masks on both systems with activated, disabled and not selected dynamic fields.
Checklist
[x] The code change is tested and works locally.(❗)
[x] There is no commented out code in this PR.(❕)
[ ] You improved or added new unit tests.(❕)
[ ] Local ZnunyCodePolicy passed.(❕)
[ ] Local UnitTests / Selenium passed.(❕)
[ ] GitHub workflow CI (UnitTests / Selenium) passed.(❗)
Proposed change
In some cases the widget "Dynamic Fields" or "Dynamic Info" are shown empty.
I have found two causes for the problem. Both problems should be solved by my change.
[% IF !TicketFrontendConfig.DynamicField.empty %]
is not always empty. If you configure a dynamic field in a screen as deactivated, it will occure in the variableTicketFrontendConfig.DynamicField
.empty()
in the code[% IF !TicketFrontendConfig.DynamicField.empty %]
does not return the correct value in older versions of template toolkit.On CentOS 7, perl v5.16.3, Template Toolkit 2.24, the method
TicketFrontendConfig.DynamicField.empty
returns "".On Oracle 9.3, perl v5.32.1, Template Toolkit 3.009, under the same circumstances, the method returns "1".
I tested the following code in AgentTicketPhone.tt on both systems:
Output Template Toolkit 2.24:
Output Template Toolkit 3.009:
Type of change
Additional information
I also removed the condition from AgentTicketActionCommon.tt and AgentTicketNoteToLinkedTicket.tt because the dynamic fields are added to these masks through the RenderBlock methods.
I did my best to test all different masks on both systems with activated, disabled and not selected dynamic fields.
Checklist