[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Fix php notices on every page introduced by !10229 and !10841

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

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
e96a2981 by Benoit Grégoire at 2026-08-27T15:49:00+00:00
[FIX] Fix php notices on every page introduced by !10229 and !10841
---
* [FIX] Fix php notices on every page introduced by !10229 and !10841[FIX] Fix php notices on every page introduced by !10229 and !10841

See merge request tikiwiki/tiki!11076

- - - - -


1 changed file:

- templates/modules/mod-search.tpl


Changes:

=====================================
templates/modules/mod-search.tpl
=====================================
@@ -157,21 +157,23 @@ $("#search_mod_input_{{$search_mod_usage_counter}}")
                         {rdelim},
                         excludeIdentifiers: (function() {ldelim}
                             const ids = {ldelim}{rdelim};
-                            {foreach from=$smod_params.autocomplete_exclude_parent_ids key=key item=id}
-                                const pair{$key} = "{$id|escape:javascript}".split(':');
-                                if (ids[pair{$key}[0]]) {ldelim}
-                                    if (Array.isArray(ids[pair{$key}[0]])) {ldelim}
-                                        ids[pair{$key}[0]].push(pair{$key}[1]);
+                            {if isset($smod_params.autocomplete_exclude_parent_ids)}
+                               {foreach from=$smod_params.autocomplete_exclude_parent_ids key=key item=id}
+                                    const pair{$key} = "{$id|escape:javascript}".split(':');
+                                    if (ids[pair{$key}[0]]) {ldelim}
+                                        if (Array.isArray(ids[pair{$key}[0]])) {ldelim}
+                                            ids[pair{$key}[0]].push(pair{$key}[1]);
+                                        {rdelim} else {ldelim}
+                                            ids[pair{$key}[0]] = [ids[pair{$key}[0]], pair{$key}[1]];
+                                        {rdelim}
                                     {rdelim} else {ldelim}
-                                        ids[pair{$key}[0]] = [ids[pair{$key}[0]], pair{$key}[1]];
+                                        ids[pair{$key}[0]] = pair{$key}[1];
                                     {rdelim}
-                                {rdelim} else {ldelim}
-                                    ids[pair{$key}[0]] = pair{$key}[1];
-                                {rdelim}
-                            {/foreach}
+                                {/foreach}
+                            {/if}
                             return ids;
                         {rdelim})(),
-                        types: [{foreach from=$smod_params.autocomplete_objecttypes item=type}"{$type|escape:javascript}"{if !$smarty.foreach.type.last},{/if}{/foreach}]
+                        types: [{if isset($smod_params.autocomplete_objecttypes)}{foreach from=$smod_params.autocomplete_objecttypes item=type}"{$type|escape:javascript}"{if !$smarty.foreach.type.last},{/if}{/foreach}{/if}]
                     {/capture}
                     {autocomplete element="#search_mod_input_"|cat:$search_mod_usage_counter type="search_module" options=$smarty.capture.selectFn}
                 {/if}



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

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