Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process: DynamicField TextArea: Notification Tag: <OTOBO_TICKET_DynamicField_Fieldname> differently in TicketCreate & ArticleCreate #4110

Closed
StefanAbel-OTOBO opened this issue Jan 27, 2025 · 1 comment · Fixed by #4119
Assignees
Labels
bug Something isn't working as intended
Milestone

Comments

@StefanAbel-OTOBO
Copy link
Contributor

When using <OTOBO_TICKET_DynamicField_Fieldname> for a multi-line DynamicField TextArea in the body of ArticleCreate transition action and TicketCreate transition action, it behaves differently.
In ArticleCreate it looks as intended with line breaks.
In TicketCreate it just adds one line for the whole tag.

TextArea Definition:
Image

ArticleCreate:
Body:
<OTOBO_TICKET_DynamicField_TextArea>
Result:
Image

TicketCreate:
Body:
<OTOBO_TICKET_DynamicField_TextArea>
Result:
Image

The test and line breaks before and after in my screenshots are not necessary, I just wanted to do the whole test.

Tested on ov294 with OTOBO 11.0.7.

@StefanAbel-OTOBO StefanAbel-OTOBO added the bug Something isn't working as intended label Jan 27, 2025
@stefanhaerter stefanhaerter added this to the OTOBO 11.0 milestone Jan 28, 2025
@stefanhaerter
Copy link
Contributor

I had a quick look. My assumption would be that this is due to TicketArticleCreate having a dedicated handling for HTML dynamic field values:

# Convert DynamicField value to HTML string, see bug#14229.
my $HTMLUtilsObject = $Kernel::OM->Get('Kernel::System::HTMLUtils');
if ( $Param{Config}->{Body} =~ /OTOBO_TICKET_DynamicField_/ ) {
MATCH:
for my $Match ( sort keys %{ $Param{Ticket} } ) {
if ( $Match =~ m/DynamicField_(.*)/ && $Param{Ticket}->{$Match} ) {
my $DynamicFieldConfig = $DynamicFieldObject->DynamicFieldGet(
Name => $1,
);
# Check if there is HTML content.
my $IsHTMLContent = $DynamicFieldBackendObject->HasBehavior(
DynamicFieldConfig => $DynamicFieldConfig,
Behavior => 'IsHTMLContent',
);
# Avoid duble conversion to HTML for dynamic fields with HTML content.
next MATCH if $IsHTMLContent;
$Param{Ticket}->{$Match} = $HTMLUtilsObject->ToHTML(
String => $Param{Ticket}->{$Match},
);
}
}
}

If this holds true, rel-10_1 and rel-10_0 may also be affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
2 participants