Overview
Comment:Fix update when non-official directories exist in the files storage
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable | 1.1.10
Files: files | file ages | folders
SHA3-256: 578805a5392a02434570ac7642998b2c86e00066857061c03449fb44e80ae13a
User & Date: bohwaz on 2021-07-16 17:38:16
Other Links: manifest | tags
Context
2021-07-24
15:03
Fix LIKE handling to be correct for "begins with" and "ends with" LIKEs, see [28fc79a800036f41] check-in: e214118d85 user: bohwaz tags: trunk, stable
2021-07-16
17:38
Fix update when non-official directories exist in the files storage check-in: 578805a539 user: bohwaz tags: trunk, stable, 1.1.10
17:30
Fix dot-directories issue check-in: 811e54d7d8 user: bohwaz tags: trunk, stable, 1.1.10
Changes

Modified src/include/lib/Garradin/Files/Files.php from [dac7d36ab5] to [1c2405702d].

341
342
343
344
345
346
347





348
349
350
351
352
353
354
355
356
357

		$db = DB::getInstance();
		$db->begin();

		$db->exec('CREATE TEMP TABLE IF NOT EXISTS tmp_files AS SELECT * FROM files WHERE 0;');

		foreach (Files::list($parent) as $file) {





			$db->insert('tmp_files', $file->asArray(true));

			if ($recursive && $file->type === $file::TYPE_DIRECTORY) {
				self::syncVirtualTable($file->path, $recursive);
			}
		}

		$db->commit();
	}
}







>
>
>
>
>










341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362

		$db = DB::getInstance();
		$db->begin();

		$db->exec('CREATE TEMP TABLE IF NOT EXISTS tmp_files AS SELECT * FROM files WHERE 0;');

		foreach (Files::list($parent) as $file) {
			// Ignore additional directories
			if ($parent == '' && !array_key_exists($file->name, File::CONTEXTS_NAMES)) {
				continue;
			}

			$db->insert('tmp_files', $file->asArray(true));

			if ($recursive && $file->type === $file::TYPE_DIRECTORY) {
				self::syncVirtualTable($file->path, $recursive);
			}
		}

		$db->commit();
	}
}