From 49ef7cd5568042051913ff9750bce09d47bfbec1 Mon Sep 17 00:00:00 2001 From: altairis-melina <91946767+altairis-melina@users.noreply.github.com> Date: Tue, 28 May 2024 23:54:44 +0200 Subject: [PATCH] FIX: langs in common docgenerator (#29774) --- htdocs/core/class/commondocgenerator.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 339ca17396dc6..3f2a1ca1fdb45 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -4,9 +4,10 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Marcos García - * Copyright (C) 2016-2023 Charlene Benke + * Copyright (C) 2016-2023 Charlene Benke * Copyright (C) 2018-2023 Frédéric France * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2024 Mélina Joum * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1464,6 +1465,11 @@ public function getExtrafieldsInHtml($object, $outputlangs, $params = array()) continue; } + // Load language if required + if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) { + $outputlangs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); + } + $field = new stdClass(); $field->rank = intval($extrafields->attributes[$object->table_element]['pos'][$key]); $field->content = $this->getExtrafieldContent($object, $key, $outputlangs);