Browse Source

theme_install only needs to return the newly created ID

Signed-off-by: Suki <[email protected]>
Suki 10 years ago
parent
commit
02db9e3d98
2 changed files with 2 additions and 3 deletions
  1. 1 2
      Sources/Subs-Themes.php
  2. 1 1
      Sources/Themes.php

+ 1 - 2
Sources/Subs-Themes.php

@@ -311,9 +311,8 @@ function theme_install($to_install = array())
 
 					// Done with the update, tell the user about it.
 					$context['to_install']['updated'] = true;
-					$context['to_install']['id'] = $to_update['id_theme'];
 
-					return $context['to_install'];
+					return $to_update['id_theme'];
 					break; // Just for reference.
 				case 0: // This is exactly the same theme.
 				case -1: // The one being installed is older than the one already installed.

+ 1 - 1
Sources/Themes.php

@@ -1326,7 +1326,7 @@ function InstallFile()
 		$theme_info = get_theme_info($dirtemp);
 		$context['to_install'] += $theme_info;
 
-		// Install the theme. theme_install() will take care of possible errors.
+		// Install the theme. theme_install() will return the new installed ID.
 		$context['to_install']['id'] = theme_install($context['to_install']);
 
 		// Rename the temp dir to the actual theme name.