[TikiWiki-commits] [Git][tikiwiki/tiki][master] [REF] Remove ambiguity between section name 'cms' and objectType 'article'

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

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


Commits:
8bc44c2d by ushindi bienvenu at 2025-12-04T21:18:43+00:00
[REF] Remove ambiguity between section name 'cms' and objectType 'article'
---
* [REF] Remove ambiguity between section name 'cms' and objectType 'article'

See merge request tikiwiki/tiki!9090

- - - - -


2 changed files:

- lib/freetag/freetaglib.php
- tiki-read_article.php


Changes:

=====================================
lib/freetag/freetaglib.php
=====================================
@@ -437,13 +437,13 @@ class FreetagLib extends ObjectLib
      */
     public function get_tags_on_object($itemId, $type, $offset = 0, $maxRecords = -1, $user = null)
     {
-        if (! isset($itemId) || ! isset($type) || empty($itemId) || empty($type) || is_array($itemId) || ! is_string($type)) {
+        if (empty($itemId) || empty($type) || is_array($itemId) || ! is_string($type)) {
             return false;
         }
 
         $bindvals = [$itemId, $type];
 
-        if (isset($user) && (! empty($user))) {
+        if ((! empty($user))) {
             $mid = 'AND `user` = ?';
             $bindvals[] = $user;
         } else {


=====================================
tiki-read_article.php
=====================================
@@ -62,12 +62,7 @@ if ($prefs['feature_categories'] == 'y') {
 //This is basicaly a copy of part of the freetag code from tiki-setup.php and should be only there. The problem is that the section name for articles is "cms" and the object name for article in the table tiki_objects is "article". Maybe it is a good idea to use "cms" on tiki_objects instead "article" and then this block of code can be removed. Another solution?
 if ($prefs['feature_freetags'] == 'y') {
     $freetaglib = TikiLib::lib('freetag');
-    $here = $sections[$section];
-    if (isset($here['itemkey']) and isset($_REQUEST[$here['itemkey']])) {
-        $objectTags = $freetaglib->get_tags_on_object($_REQUEST[$here['itemkey']], "article " . $_REQUEST[$here['key']]);
-    } elseif (isset($here['key']) and isset($_REQUEST[$here['key']])) {
-        $objectTags = $freetaglib->get_tags_on_object($_REQUEST[$here['key']], "article");
-    }
+    $objectTags = $freetaglib->get_tags_on_object($_REQUEST['articleId'], "article");
     $tags = [];
     if ($objectTags) {
         $tags = $objectTags['data'];



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

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