Skip to content

Fix - Use dropdown translation in generated ticket content - #25250

Open
erique-souza wants to merge 3 commits into
glpi-project:11.0/bugfixesfrom
erique-souza:fix/25249-dropdown-translation-in-ticket-content
Open

Fix - Use dropdown translation in generated ticket content#25250
erique-souza wants to merge 3 commits into
glpi-project:11.0/bugfixesfrom
erique-souza:fix/25249-dropdown-translation-in-ticket-content

Conversation

@erique-souza

Copy link
Copy Markdown

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

Description

QuestionTypeItem::formatRawAnswer() reads the raw completename / friendly name
of the answered item, so the value frozen into the generated ticket content and
title is always in the source language, even when a DropdownTranslation exists
for the requester's language.

The ticket content is built once at submission time and stored in
glpi_tickets.content, so the value has to be resolved at that moment — there is
no later render that could apply the translation.

The other fields['completename'] read in this file, in
transformConditionValueForComparisons(), is deliberately left alone: conditions
must compare against the source value, otherwise form logic would depend on the
viewer's language.

The breadcrumb half of the issue is already fixed on 11.0/bugfixes by #24678,
so it is not included here.

Added testFormatRawAnswerUsesDropdownTranslation as a non-regression test: it
builds a Location tree, adds an fr_FR translation, logs in as a French user
and asserts the translated value is returned.

Reproduced and verified on a production instance running 11.0.8, pt_PT install
with en_GB users, applied via a bind-mount over the container file.

fix(form): use dropdown translation in generated ticket content
test(form): cover dropdown translation in formatRawAnswer
fix(form): keep getFriendlyName for non-dropdown items
@trasher

trasher commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Tests are failing, please check

@Rom1-B Rom1-B left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix CI

@trasher trasher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service catalog breadcrumb and generated ticket content ignore DropdownTranslation

3 participants