[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] sections: Continuing fixes following the refactoring

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a3bd6fa79b80_38198994-3ed@gitlab-sidekiq-low-urgency-cpu-bound-v2-859fddd4b4-8csmm.mail>

Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
0b4c4fcc by Jonny Bradley at 2026-06-24T12:52:10+00:00
[FIX] sections: Continuing fixes following the refactoring
---
* [FIX] sections: No need to trigger the section callbacks if the section doesn't change

* [FIX] sections: If two ajax calls happen, and the second one needs the iconset (e.g. edit a field click save), then the iconset was missing, so add it also in the js_config but a higher rank than the mina jqueryTiki initialisation so it gets rendered later

See merge request tikiwiki/tiki!10591

- - - - -


2 changed files:

- lib/core/Sections.php
- lib/setup/theme.php


Changes:

=====================================
lib/core/Sections.php
=====================================
@@ -270,10 +270,12 @@ class Sections
         if (! in_array($section, self::getAllSections(), true)) {
             throw new \InvalidArgumentException("Invalid section: $section");
         }
-        self::$currentSection = $section;
 
-        // Trigger callbacks when section changes
-        self::triggerSectionChangeCallbacks($section);
+        if (self::$currentSection !== $section) {
+            // Trigger callbacks when section changes
+            self::$currentSection = $section;
+            self::triggerSectionChangeCallbacks($section);
+        }
     }
 
     public static function getCurrentSection(): ?string


=====================================
lib/setup/theme.php
=====================================
@@ -191,8 +191,9 @@ Sections::onSectionChange(function ($section) {
     //8) produce $iconset to be used for generating icons
     $iconset = TikiLib::lib('iconset')->getIconsetForTheme($theme_active, $theme_option_active);
     // and add js support file
-    $headerlib->add_js('jqueryTiki.iconset = ' . json_encode($iconset->getJS()));
     $headerlib->add_jsfile('lib/jquery_tiki/iconsets.js');
+    // because theme setup now happens before javascript, we need to add this in js_config but to render after the initial setup of jqueryTiki
+    $headerlib->add_js_config('jqueryTiki.iconset = ' . json_encode($iconset->getJS()), 10);
 
     //Note: if Theme Control is active, than tiki-tc.php can modify the active theme
 



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0b4c4fcc41b6da7e96cb4d0425fe07ce7e8938ec

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0b4c4fcc41b6da7e96cb4d0425fe07ce7e8938ec
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
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.