[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] wysiwyg: Fix js for multilingual CKEDITOR when the language code...

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68f0dec737ba8_2ce0bf065699@gitlab-sidekiq-low-urgency-cpu-bound-v2-7678f7dc6f-vjrrj.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
5dc03469 by Jonny Bradley at 2025-10-16T11:55:44+00:00
[FIX] wysiwyg: Fix js for multilingual CKEDITOR when the language code...
---
* [FIX] CI: Irrelevant fix to try and make the shlint pipeline pass (need to get on!)

* [FIX] wysiwyg: Left over bool

* [FIX] wysiwyg: Fix multiple (e.g. multilingual) CKEDITORs to find the right textarea to add images to, as `setupCKEditorTool` currently makes the button onclick handlers the same for all editors (bad)

* [FIX] wysiwyg: Fix js for multilingual CKEDITOR when the language code contains a hyphen (minus character), e,g, "en-uk"

See merge request tikiwiki/tiki!8793

- - - - -


3 changed files:

- doc/devtools/provide_tarballs.sh
- lib/core/Toolbar/ToolbarFileGallery.php
- lib/smarty_tiki/BlockHandler/TextArea.php


Changes:

=====================================
doc/devtools/provide_tarballs.sh
=====================================
@@ -75,7 +75,7 @@ fi
 
 echo "Cleanup packaging folder and rebuild"
 rm -rf "${PACKDIR:?}/${BRANCH:?}"
-cp -r ${BASE}/data/"${BRANCH}" ${PACKDIR}
+cp -R ${BASE}/data/"${BRANCH}" ${PACKDIR}
 
 # cleanup
 if [ -d "${PACKDIR}/${BRANCH}" ]; then


=====================================
lib/core/Toolbar/ToolbarFileGallery.php
=====================================
@@ -72,6 +72,9 @@ class ToolbarFileGallery extends ToolbarUtilityItem
         if (! empty($this->wysiwyg)) {
             $exec_js = str_replace('&amp;', '&', $this->getOnClick());
 
+            // CKEDITOR shares the same onclick between all instances, so we need to replace the filegals_manager parameter
+            $exec_js = preg_replace('/filegals_manager=[^&]*/', "filegals_manager=' + editor.element.getId() + '", $exec_js);
+
             $this->setupCKEditorTool($exec_js);
         }
         return $this->wysiwyg;


=====================================
lib/smarty_tiki/BlockHandler/TextArea.php
=====================================
@@ -216,7 +216,7 @@ class TextArea extends Base
     CKEDITOR.replace( "' . $as_id . '",' . $ckoptions . ');
     CKEDITOR.on("instanceReady", function(event) {
     if (typeof ajaxLoadingHide == "function") { ajaxLoadingHide(); }
-    this.instances.' . $as_id . '.resetDirty();
+    this.instances["' . $as_id . '"].resetDirty();
     });
         ',
                     20



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5dc03469c05f55e83b2a1a6d40747c6ab8cfdbd2

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5dc03469c05f55e83b2a1a6d40747c6ab8cfdbd2
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.