Prechádzať zdrojové kódy

changed config items log to reflect only changed keys

CauseFX 3 rokov pred
rodič
commit
ea7386cb7a
1 zmenil súbory, kde vykonal 8 pridanie a 5 odobranie
  1. 8 5
      api/classes/organizr.class.php

+ 8 - 5
api/classes/organizr.class.php

@@ -2743,7 +2743,8 @@ class Organizr
 			$this->setAPIResponse('error', 'No data submitted', 409);
 			return false;
 		}
-		$newItem = array();
+		$newItems = [];
+		$updatedItems = [];
 		foreach ($array as $k => $v) {
 			$v = $v ?? '';
 			switch ($v) {
@@ -2773,14 +2774,16 @@ class Organizr
 					break;
 			}
 			if (strtolower($k) !== 'formkey') {
-				$newItem[$k] = $v;
+				if ($this->config[$k] !== $v) {
+					$updatedItems[$k] = $v;
+				}
+				$newItems[$k] = $v;
 				$this->config[$k] = $v;
 			}
 		}
 		$this->setAPIResponse('success', 'Config items updated', 200);
-		$this->setLoggerChannel('Config');
-		$this->logger->info('Config items updated', array_keys($array));
-		return (bool)$this->updateConfig($newItem);
+		$this->setLoggerChannel('Config')->notice('Config items updated', array_keys($updatedItems));
+		return (bool)$this->updateConfig($newItems);
 	}
 
 	public function updateConfigItem($array)