Overview
Comment:Fix: also update file_path when moving a category
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: ed4415500283b2ac0515da9142deaa2924887fcda90598eee031a994d3ad2829
User & Date: bohwaz on 2021-11-29 16:40:06
Other Links: manifest | tags
Context
2021-11-30
14:38
Fix checkbox in chart editing check-in: fea7d49f1e user: bohwaz tags: trunk, stable
2021-11-29
16:40
Fix: also update file_path when moving a category check-in: ed44155002 user: bohwaz tags: trunk, stable
16:15
Open text editor after creating a new text file, also resize the iframe correctly check-in: 2e84f0e59a user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Entities/Web/Page.php from [772b590b56] to [d8d50d5663].

218
219
220
221
222
223
224
225

226
227
228
229
230
231
232

		// Rename/move children
		if ($change_parent) {
			$db = DB::getInstance();
			$sql = sprintf('UPDATE web_pages
				SET
					path = %1$s || substr(path, %2$d),
					parent = %1$s || substr(parent, %2$d)

				WHERE path LIKE %3$s;',
				$db->quote($this->path), strlen($change_parent) + 1, $db->quote($change_parent . '/%'));
			$db->exec($sql);
		}

		return true;
	}







|
>







218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233

		// Rename/move children
		if ($change_parent) {
			$db = DB::getInstance();
			$sql = sprintf('UPDATE web_pages
				SET
					path = %1$s || substr(path, %2$d),
					parent = %1$s || substr(parent, %2$d),
					file_path = \'web/\' || %1$s || substr(file_path, %2$d + 4)
				WHERE path LIKE %3$s;',
				$db->quote($this->path), strlen($change_parent) + 1, $db->quote($change_parent . '/%'));
			$db->exec($sql);
		}

		return true;
	}