From 0cfd84966fa345fc20095fa65966fbab98f13e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Thu, 22 Oct 2020 16:06:18 +0200 Subject: [PATCH] fixed tinyMce path for contao 4.4 --- CHANGELOG.md | 3 +++ src/Widget/MultiColumnEditor.php | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ad5389b..59d3abf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All notable changes to this project will be documented in this file. +## [2.11.1] - 2020-10-22 +- fixed tinyMce path for contao 4.4 + ## [2.11.0] - 2020-10-20 - added row_inner block to default editor template - fixes row indices not correctly updated on adding and deleting rows diff --git a/src/Widget/MultiColumnEditor.php b/src/Widget/MultiColumnEditor.php index 77c465b2..a53ff764 100644 --- a/src/Widget/MultiColumnEditor.php +++ b/src/Widget/MultiColumnEditor.php @@ -106,8 +106,14 @@ public function generate(): string } if ($hasTinyMce) { - $template = new FrontendTemplate(); - $responseText = ''.$responseText; + if (version_compare(VERSION, '4.5') >= 0) { + $template = new FrontendTemplate(); + $tinyMcePath = $template->asset('js/tinymce.min.js', 'contao-components/tinymce4'); + } else { + $tinyMcePath = TL_ASSETS_URL.'assets/tinymce4/js/tinymce.min.js'; + } + + $responseText = ''.$responseText; } if ($this->container->get('huh.utils.container')->isBackend()) {