Sector Nord AG: Bugfix: Hide empty dynamic info/dynamic field box #550
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 variable
TicketFrontendConfig.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