[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Fix browser title not displaying correctly after database update

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68e58aa2462e4_2cf5f60413224@gitlab-sidekiq-low-urgency-cpu-bound-v2-5b754674d6-7k4cq.mail>

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


Commits:
2125a8df by Moïse Nturubika at 2025-10-07T21:40:21+00:00
[FIX] Fix browser title not displaying correctly after database update
---
* [FIX] Update all preferences from database during installation

* [FIX] Simplify update_preferences function

* [ENH] Add proper documentation for update_preference function

* [FIX] Allow selective update of empty preferences during installation

* [FIX] Fix browser title not displaying correctly after database update

See merge request tikiwiki/tiki!7524

- - - - -


1 changed file:

- installer/installlib.php


Changes:

=====================================
installer/installlib.php
=====================================
@@ -289,9 +289,14 @@ function get_admin_email()
 }
 
 /**
- * @param $dbTiki
- * @param $prefs
- * @return bool
+ * Updates preferences from the database into the provided preferences array.
+ * This function is used during installation to ensure certain preferences are properly set.
+ *
+ * The function updates all preferences from the database,
+ * ensuring database values take precedence over default values during installation/upgrade.
+ *
+ * @param array &$prefs Reference to the preferences array to update
+ * @return bool True if database query was successful, false otherwise
  */
 function update_preferences(&$prefs)
 {
@@ -299,18 +304,18 @@ function update_preferences(&$prefs)
     $query = "SELECT `name`, `value` FROM `tiki_preferences`";
     @$result = $installer->query($query);
 
-    if ($result) {
-        while ($res = $result->fetchRow()) {
-            if (! isset($prefs[$res['name']])) {
-                $prefs[$res['name']] = $res['value'];
-            }
-        }
-        return true;
+    if (! $result) {
+        return false;
     }
 
-    return false;
+    while ($res = $result->fetchRow()) {
+        $prefs[$res['name']] = $res['value'];
+    }
+
+    return true;
 }
 
+
 /**
  * @param $account
  */



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

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