[TikiWiki-commits] [Git][tikiwiki/tiki][tiki-article] Fix: Display required feature in module error message instead of module name

"Espoir Baraka \(@esbarakabigega\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68f3f5df52703_2c22e604c939f3@gitlab-sidekiq-low-urgency-cpu-bound-v2-6fddc7596d-x6hjz.mail>

Espoir Baraka pushed to branch tiki-article at Tiki Wiki CMS Groupware / Tiki


Commits:
251b36f2 by espoirbaraka at 2025-10-18T22:17:18+02:00
Fix: Display required feature in module error message instead of module name

- - - - -


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: '. $preference .'. 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/251b36f2ed5bf15fa6eff622803e4241d979684b

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