Skip to content
Permalink
Browse files

Keep dev and live assets in sync on rename

See #1477.
  • Loading branch information
Bloke committed Mar 24, 2020
1 parent 9d1fb51 commit 943a9c4b6bbc2838b679a30486d3f32352dc5b93
Showing with 4 additions and 2 deletions.
  1. +2 −1 textpattern/include/txp_css.php
  2. +2 −1 textpattern/include/txp_page.php
@@ -356,7 +356,8 @@ function css_save()
if (safe_update('txp_css',
"css = '$css', name = '$safe_newname', skin = '$safe_skin'",
"name = '$safe_name' AND skin = '$safe_skin'")) {
safe_update('txp_section', "css = '$safe_newname'", "css='$safe_name'");
safe_update('txp_section', "css = '$safe_newname'", "css='$safe_name' AND skin='$safe_skin'");
safe_update('txp_section', "dev_css = '$safe_newname'", "dev_css='$safe_name' AND dev_skin='$safe_skin'");
set_pref('last_css_saved', $newname, 'css', PREF_HIDDEN, 'text_input', 0, PREF_PRIVATE);
update_lastmod('css_saved', compact('newname', 'name', 'css'));

@@ -423,7 +423,8 @@ function page_save()
if (safe_update('txp_page',
"user_html = '$html', name = '$safe_newname', skin = '$safe_skin'",
"name = '$safe_name' AND skin = '$safe_skin'")) {
safe_update('txp_section', "page = '$safe_newname'", "page='$safe_name'");
safe_update('txp_section', "page = '$safe_newname'", "page='$safe_name' AND skin='$safe_skin'");
safe_update('txp_section', "dev_page = '$safe_newname'", "dev_page='$safe_name' AND dev_skin='$safe_skin'");
set_pref('last_page_saved', $newname, 'page', PREF_HIDDEN, 'text_input', 0, PREF_PRIVATE);
update_lastmod('page_saved', compact('newname', 'name', 'html'));

0 comments on commit 943a9c4

Please sign in to comment.
You can’t perform that action at this time.