[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Attempt to call $headerlib->add_js() after output in wikiplugin_tracker...

"Merci Jacob \(@mercihabam\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69935de86a42_3b18702c65358@gitlab-sidekiq-low-urgency-cpu-bound-v2-6547747b55-vsr2l.mail>

Merci Jacob pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
cad49a12 by Merci Jacob at 2026-02-16T18:04:11+00:00
[FIX] Attempt to call $headerlib->add_js() after output in wikiplugin_tracker and duplicate tracker register form when specifying default group by url parameter
---
* fix phpcs

* [FIX] Duplicate tracker form: avoid fetching the form as it's already handled by UserRegistration.php

* [FIX] attempt to call $headerlib->add_js() after output

See merge request tikiwiki/tiki!9577

- - - - -


3 changed files:

- lib/headerlib.php
- lib/wiki-plugins/wikiplugin_tracker.php
- templates/register-groupchoice.tpl


Changes:

=====================================
lib/headerlib.php
=====================================
@@ -954,13 +954,8 @@ class HeaderLib
         return $this;
     }
 
-    public function output_js($wrap = true)
+    public function outputInlineJS($wrap = true)
     {
-        // called in tiki.tpl - JS output at end of file now (pre 5.0)
-        $this->outputStaticJSFooterWasStartedBy = $this->getOutputCallerInfo();
-        global $prefs;
-
-
         ksort($this->js);
         ksort($this->jq_onready);
 
@@ -1000,6 +995,14 @@ class HeaderLib
         return $back;
     }
 
+    public function output_js($wrap = true)
+    {
+        // called in tiki.tpl - JS output at end of file now (pre 5.0)
+        $this->outputStaticJSFooterWasStartedBy = $this->getOutputCallerInfo();
+
+        return $this->outputInlineJS($wrap);
+    }
+
     /**
      * Gets JavaScript and jQuery scripts as an array (for AJAX)
      * @return array[strings]


=====================================
lib/wiki-plugins/wikiplugin_tracker.php
=====================================
@@ -2327,7 +2327,7 @@ FILL;
         }
 
         if (! empty($params['_ajax_form_ins_id'])) {    // save new js in a function for the form init fn
-            $headerlib->add_js(' var ajaxTrackerFormInit_' . $params['_ajax_form_ins_id'] . ' = function() {' . $headerlib->output_js(false) . '}', 10);
+            $headerlib->add_js(' var ajaxTrackerFormInit_' . $params['_ajax_form_ins_id'] . ' = function() {' . $headerlib->outputInlineJS(false) . '}', 10);
 
             // put back the pre-existing js
             $headerlib->js = array_merge($headerlib->js, $old_js['js']);


=====================================
templates/register-groupchoice.tpl
=====================================
@@ -21,12 +21,6 @@
     {* Groups *}
     {if isset($theChoiceGroup)}
         <input type="hidden" name="chosenGroup" value="{$theChoiceGroup|escape}">
-        {jq}
-$.getJSON('group_tracker_ajax.php', {chosenGroup:'{{$theChoiceGroup}}'}, function(data) {
-    $("#registerTracker").html(data['res']).tikiModal();
-});
-        {/jq}
-        <div id="registerTracker"></div>
     {elseif isset($listgroups)}
         <div class="mb-3 row">
             <label class="col-sm-4 col-form-label">



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cad49a121829b5fe8cb1e010a3fcc37cab0372c1
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.