Skip to content

Commit

Permalink
fix(textarea): workaround GLPI bug in 9.4.5
Browse files Browse the repository at this point in the history
see glpi-project/glpi#6811

close #1613

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 22, 2020
1 parent fb9b72a commit 3d53b18
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions inc/fields/textareafield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* You should have received a copy of the GNU General Public License
* along with Formcreator. If not, see <http://www.gnu.org/licenses/>.
* ---------------------------------------------------------------------
* @copyright Copyright © 2011 - 2020 Teclib'
* @copyright Copyright © 2011 - 2019 Teclib'
* @license http://www.gnu.org/licenses/gpl.txt GPLv3+
* @link https://github.com/pluginsGLPI/formcreator/
* @link https://pluginsglpi.github.io/formcreator/
Expand Down Expand Up @@ -78,14 +78,17 @@ public function getRenderedHtml($canEdit = true) {
$value = nl2br($this->value);
$html = '';
$html .= Html::textarea([
'name' => $fieldName,
'rand' => $rand,
'value' => $value,
'rows' => 5,
'display' => false,
'enable_richtext' => true,
'enable_fileupload'=> true,
'name' => $fieldName,
'rand' => $rand,
'value' => $value,
'rows' => 5,
'display' => false,
'enable_richtext' => true,
'enable_fileupload' => true,
]);
if (version_compare(GLPI_VERSION, '9.4.6') < 0) {
$html .= '</div>';
}
$html .= Html::scriptBlock("$(function() {
pluginFormcreatorInitializeTextarea('$fieldName', '$rand');
});");
Expand Down

0 comments on commit 3d53b18

Please sign in to comment.