Skip to content

Commit

Permalink
Updating a theme should always keep the custom files
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Apr 29, 2021
1 parent 3aa4704 commit 9f5a15f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

1. [](#new)
* Added `MediaUploadTrait::checkFileMetadata()` method
1. [](#improved)
* Updating a theme should always keep the custom files [getgrav/grav-plugin-admin#2135](https://github.com/getgrav/grav-plugin-admin/issues/2135)
1. [](#bugfix)
* Fixed broken numeric language codes in Flex Pages [#3332](https://github.com/getgrav/grav/issues/3332)
* Fixed broken `exif_imagetype()` twig function
Expand Down
5 changes: 4 additions & 1 deletion system/src/Grav/Common/GPM/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ public static function install($zip, $destination, $options = [], $extracted = n
}

if (!$options['sophisticated']) {
if ($options['theme']) {
$isTheme = $options['theme'] ?? false;
// Make sure that themes are always being copied, even if option was not set!
$isTheme = $isTheme || preg_match('|/themes/[^/]+|ui', $install_path);
if ($isTheme) {
self::copyInstall($extracted, $install_path);
} else {
self::moveInstall($extracted, $install_path);
Expand Down

0 comments on commit 9f5a15f

Please sign in to comment.