[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][FIX] Dynamic menu options not displaying after creation.

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68af0d53ca0f7_2cd730c428d9@gitlab-sidekiq-low-urgency-cpu-bound-v2-75c5d7f49c-wnzt9.mail>

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


Commits:
4cc58e60 by NasserNgandu at 2025-08-27T13:44:42+00:00
[BP][FIX] Dynamic menu options not displaying after creation.
---
* [FIX] Dynamic menu options not displaying after creation.
---
* [FIX] Dynamic menu options not displaying after creation.
---
* [FIX] Code correction.

* [FIX] Code correction.

* [FIX] Pipeline fix.

* [FIX] Pipeline fix.

* [FIX] Reformatting of categGroups.

* [FIX] Dynamic menu options not displaying after creation.

See merge request tikiwiki/tiki!7254

See merge request tikiwiki/tiki!7503

See merge request tikiwiki/tiki!8040

- - - - -


1 changed file:

- lib/smarty_tiki/FunctionHandler/Menu.php


Changes:

=====================================
lib/smarty_tiki/FunctionHandler/Menu.php
=====================================
@@ -107,17 +107,25 @@ class Menu extends Base
 
             if (! empty($channels['data'])) {
                 // Builds Menus nested tree of options
+                $formattedCategGroups = array_reduce(
+                    $categGroups,
+                    function ($accumulatedGroups, $item) {
+                        return $accumulatedGroups + $item;
+                    },
+                    []
+                );
                 foreach ($channels['data'] as $element) {
                     $attribute = \TikiLib::lib('attribute')->get_attribute('menu', $element["optionId"], 'tiki.menu.templatedgroupid');
-                    if ($attribute && $catName = $categGroups[$attribute]) {
+                    if ($attribute) {
+                        if (! array_key_exists($attribute, $formattedCategGroups) || empty($formattedCategGroups[$attribute])) {
+                            continue;
+                        }
+                        $catName = $formattedCategGroups[$attribute];
                         $element["name"] = str_replace("--groupname--", $catName, $element["name"]);
                         $element["url"] = str_replace("--groupname--", $catName, $element["name"]);
                         $element["sefurl"] = str_replace("--groupname--", $catName, $element["sefurl"]);
                         $element["canonic"] = str_replace("--groupname--", $catName, $element["canonic"]);
-                    } elseif ($attribute && ! $categGroups[$attribute]) {
-                        continue;
                     }
-
                     if ($element['type'] !== '-') {
                         $level = $element['sectionLevel'];
                         // Creates new branch at level 0



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

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