[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] PreferencesSetCommand.php: Fix preferences:set failing when enabling

"Sammy Ndabo \(@ndabosam084\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a7f464819bd_381d53ea454513@gitlab-sidekiq-low-urgency-cpu-bound-v2-7774c44f54-kfgk9.mail>

Sammy Ndabo pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
9cb848b2 by Sammy Ndabo at 2026-08-14T16:32:19+00:00
[FIX] PreferencesSetCommand.php: Fix preferences:set failing when enabling
---
* [FIX] PreferencesSetCommand.php: Fix preferences:set failing when enabling preferences without active conflicts

See merge request tikiwiki/tiki!10885

- - - - -


1 changed file:

- lib/core/Tiki/Command/PreferencesSetCommand.php


Changes:

=====================================
lib/core/Tiki/Command/PreferencesSetCommand.php
=====================================
@@ -52,13 +52,11 @@ class PreferencesSetCommand extends Command
             return Command::FAILURE;
         }
 
-        if (count($preferenceInfo['conflicts'])) {
-            if ($value == 'y') {
-                foreach ($preferenceInfo['conflicts']['active'] as $conflict) {
-                    $output->write(sprintf("<error>[CONFLICT]: the preference %s must be disabled first.</error>", $conflict['name']));
-                }
-                return Command::FAILURE;
+        if ($value == 'y' && ! empty($preferenceInfo['conflicts']['active'])) {
+            foreach ($preferenceInfo['conflicts']['active'] as $conflict) {
+                $output->write(sprintf("<error>[CONFLICT]: the preference %s must be disabled first.</error>", $conflict['name']));
             }
+            return Command::FAILURE;
         }
 
         if ($preferenceInfo['type'] == 'flag' && ! in_array($value, ['y', 'n'])) {



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

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