Skip to content
Permalink
Browse files

Do not automatically remap missing theme images if running out of git…

… - could be that git operator is doing a resync
  • Loading branch information...
chrisgraham committed May 31, 2019
1 parent 7ade1a7 commit 9319f34d7d8e9b43634e204e91e57e232e4fbcca
Showing with 7 additions and 5 deletions.
  1. +7 −5 sources/themes.php
@@ -146,11 +146,13 @@ function find_theme_image($id, $silent_fail = false, $leave_local = false, $them
// Dynamic fixup possible?
if ($theme != 'default') {
$url_path = $db->query_select_value_if_there('theme_images', 'path', array('id' => $id, 'theme' => 'default', 'lang' => $lang));
if ($url_path !== null) {
$db->query_update('theme_images', array('path' => $url_path), array('id' => $id, 'theme' => $theme, 'lang' => $lang), '', 1);
} else {
$db->query_delete('theme_images', array('id' => $id, 'theme' => $theme, 'lang' => $lang), '', 1);
if (!file_exists(get_custom_file_base() . '/.git')) { // Do not automatically remap missing theme images if running out of git - could be that git operator is doing a resync between servers
$url_path = $db->query_select_value_if_there('theme_images', 'path', array('id' => $id, 'theme' => 'default', 'lang' => $lang));
if ($url_path !== null) {
$db->query_update('theme_images', array('path' => $url_path), array('id' => $id, 'theme' => $theme, 'lang' => $lang), '', 1);
} else {
$db->query_delete('theme_images', array('id' => $id, 'theme' => $theme, 'lang' => $lang), '', 1);
}
}
}

0 comments on commit 9319f34

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