From 258ad70852e0d7f2ad328bc4b7b86b2419b5fd09 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 5 May 2020 11:58:15 +0200 Subject: [PATCH] fix(textareafield): handle with constant the availability of #6939 for GLPI Signed-off-by: Thierry Bugier --- inc/fields/textareafield.class.php | 4 ++++ setup.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/inc/fields/textareafield.class.php b/inc/fields/textareafield.class.php index f5623428c..7dc3e4013 100644 --- a/inc/fields/textareafield.class.php +++ b/inc/fields/textareafield.class.php @@ -95,6 +95,10 @@ public function displayField($canEdit = true) { 'enable_fileupload' => false, 'uploads' => $this->uploads ]); + if (PLUGIN_FORMCREATOR_TEXTAREA_FIX && version_compare(GLPI_VERSION, '9.5.0-dev') < 0) { + // for GLPI 9.4 without patch https://github.com/glpi-project/glpi/pull/6936 + echo '
'; + } echo Html::scriptBlock("$(function() { pluginFormcreatorInitializeTextarea('$fieldName', '$rand'); });"); diff --git a/setup.php b/setup.php index 2e03b35ac..0ff164970 100644 --- a/setup.php +++ b/setup.php @@ -42,6 +42,8 @@ // Maximum GLPI version, exclusive define ('PLUGIN_FORMCREATOR_GLPI_MAX_VERSION', '9.5'); +define ('PLUGIN_FORMCREATOR_TEXTAREA_FIX', true); + define('FORMCREATOR_ROOTDOC', $CFG_GLPI['root_doc'] . '/plugins/formcreator'); /**