[TikiWiki-commits] [Git][tikiwiki/tiki][24.x] [FIX] Tiki-modules: Display required feature instead of module name in error message

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68f7ba5fcd2c6_2c986a209814c@gitlab-sidekiq-low-urgency-cpu-bound-v2-d6f4b755c-b5zmj.mail>

Benoit Grégoire pushed to branch 24.x at Tiki Wiki CMS Groupware / Tiki


Commits:
dda1d8fc by Espoir Baraka at 2025-10-21T16:46:26+00:00
[FIX] Tiki-modules: Display required feature instead of module name in error message
---
* Fix: Display required feature in module error message instead of module name

* [FIX] Tiki-modules: Display required feature instead of module name in error message

See merge request tikiwiki/tiki!8809

- - - - -


1 changed file:

- lib/modules/modlib.php


Changes:

=====================================
lib/modules/modlib.php
=====================================
@@ -11,7 +11,6 @@
  */
 class ModLib extends TikiLib
 {
-
     public $pref_errors = [];
 
     // additional module zones added to this array will be exposed to tiki.tpl
@@ -94,7 +93,7 @@ class ModLib extends TikiLib
      * @return bool
      * @throws Exception
      */
-    public function assign_module($moduleId = 0, $name, $title, $position, $order, $cache_time = 0, $rows = 10, $groups = null, $params = null, $type = null)
+    public function assign_module($moduleId, $name, $title, $position, $order, $cache_time = 0, $rows = 10, $groups = null, $params = null, $type = null)
     {
         //check for valid values
         $cache_time = is_numeric($cache_time) ? $cache_time : 0;
@@ -508,7 +507,7 @@ class ModLib extends TikiLib
         $tikilib = TikiLib::lib('tiki');
 
         $topLogin = $module['name'] === 'login_box' && $module['position'] === 'top';
-        $topQA= $module['name'] === 'quickadmin' && $module['position'] === 'top';
+        $topQA = $module['name'] === 'quickadmin' && $module['position'] === 'top';
         $footer = $module['position'] === 'bottom';
         $isControlPanel = $section === 'admin' && strpos($_SERVER['PHP_SELF'], 'tiki-admin.php') !== false;
 
@@ -1105,7 +1104,7 @@ class ModLib extends TikiLib
                             'type' => 'warning',
                             'title' => tr('Failed to execute "%0" module', $mod_reference['name']),
                         ],
-                        tr('Required features: '.$mod_reference['name'].'. If you do not have permission to activate these features, ask the site administrator.'),
+                        tr('Required features: ' . $preference . '. If you do not have permission to activate these features, ask the site administrator.'),
                         $smarty,
                         $repeat
                     );
@@ -1341,9 +1340,9 @@ class ModLib extends TikiLib
         foreach ($params as $name => & $inner) {
             if (isset($module_params[$name])) {
                 if (isset($inner['separator'])) {
-                    if(isset($inner['set_value_as_array'])){
+                    if (isset($inner['set_value_as_array'])) {
                         $inner['value'] = (array) $module_params[$name];
-                    }else{
+                    } else {
                         $inner['value'] = implode($inner['separator'], (array) $module_params[$name]);
                     }
                 } else {
@@ -1382,7 +1381,7 @@ class ModLib extends TikiLib
             }
 
             if (isset($params[$name]) && $params[$name] !== '') {
-                if (isset($def['separator']) && !is_array($params[$name]) && strpos($params[$name], $def['separator']) !== false) {
+                if (isset($def['separator']) && ! is_array($params[$name]) && strpos($params[$name], $def['separator']) !== false) {
                     $parts = explode($def['separator'], $params[$name]);
 
                     if ($filter) {



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

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