Skip to content

Commit

Permalink
fix(textareafield): handle with constant the availability of #6939 fo…
Browse files Browse the repository at this point in the history
…r GLPI

Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed May 5, 2020
1 parent 0a163d5 commit 258ad70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/fields/textareafield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<div class="fileupload_info"></div>';
}
echo Html::scriptBlock("$(function() {
pluginFormcreatorInitializeTextarea('$fieldName', '$rand');
});");
Expand Down
2 changes: 2 additions & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

/**
Expand Down

0 comments on commit 258ad70

Please sign in to comment.