[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Forums module: Fix array_slice null error in...

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6929fa9c31ce5_2ac3f7f1c5739@gitlab-sidekiq-low-urgency-cpu-bound-v2-5df5c99858-2hqk2.mail>

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


Commits:
5409a5b6 by Espoir Baraka at 2025-11-28T19:32:20+00:00
[FIX] Forums module: Fix array_slice null error in...
---
* [FIX] Forums module: Fix array_slice null error in forums_most_commented_forums module when no forums are accessible

See merge request tikiwiki/tiki!9135

- - - - -


2 changed files:

- lib/comments/commentslib.php
- lib/core/Perms.php


Changes:

=====================================
lib/comments/commentslib.php
=====================================
@@ -1530,6 +1530,7 @@ class Comments extends TikiLib
             }
             //need to sort within sections if sections are used (also works if sections aren't used)
             $sections = array_unique(array_column($result, 'section'));
+            $sorted = [];
             foreach ($sections as $section) {
                 foreach ($sortarray as $key => $data) {
                     if ($result[$key]['section'] === $section) {


=====================================
lib/core/Perms.php
=====================================
@@ -219,7 +219,7 @@ class Perms
      * @param $permission string|array The permission name to validate on each record.
      * @return array What remains of the dataset after filtering.
      */
-    public static function filter(array $baseContext, $bulkKey, array $data, array $contextMap, $permission)
+    public static function filter(array $baseContext, $bulkKey, array $data, array $contextMap, $permission): array
     {
         $cacheKey = md5(serialize($baseContext) . serialize($bulkKey) . serialize($data) . serialize($contextMap) . serialize($permission));
 



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

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