@@ -152,22 +152,18 @@ public function getAll(string $uid, $saveInitial = false) : \stdClass {
152152 $ settings = $ this ->getSettingsFromDB ($ uid );
153153 // use default for empty settings
154154 $ toBeSaved = false ;
155- $ toSaveNotesPath = false ;
156155 foreach ($ this ->attrs as $ name => $ attr ) {
157156 if (!property_exists ($ settings , $ name )) {
158157 $ defaultValue = $ attr ['default ' ];
159158 if (is_callable ($ defaultValue )) {
160159 $ settings ->{$ name } = $ defaultValue ($ uid );
161160 $ toBeSaved = $ saveInitial ;
162- if ($ name === 'notesPath ' ) {
163- $ toSaveNotesPath = true ;
164- }
165161 } else {
166162 $ settings ->{$ name } = $ defaultValue ;
167163 }
168164 }
169165 }
170- if ($ toSaveNotesPath || $ toBeSaved ) {
166+ if ($ toBeSaved ) {
171167 $ this ->set ($ uid , (array )$ settings );
172168 }
173169 return $ settings ;
@@ -176,8 +172,8 @@ public function getAll(string $uid, $saveInitial = false) : \stdClass {
176172 /**
177173 * @throws \OCP\PreConditionNotMetException
178174 */
179- public function get (string $ uid , string $ name ) : string {
180- $ settings = $ this ->getAll ($ uid );
175+ public function get (string $ uid , string $ name, bool $ saveInitial = false ) : string {
176+ $ settings = $ this ->getAll ($ uid, $ saveInitial );
181177 if (property_exists ($ settings , $ name )) {
182178 return $ settings ->{$ name };
183179 } else {
0 commit comments