| @@ -53,8 +53,9 @@ | ||
| 53 | 53 | |
| 54 | 54 | $plugins = $this->getPlugins(); |
| 55 | 55 | $data = $plugins[$plugin->name] ?? null; |
| 56 | 56 | |
| 57 | + // Prepare the missing entry in the db | |
| 57 | 58 | $newPlugin = new \stdClass(); |
| 58 | 59 | $newPlugin->title = $plugin->pluginDescription->name; |
| 59 | 60 | $newPlugin->folder_name = $plugin->name; |
| 60 | 61 | $newPlugin->version = '1.0'; |
| @@ -73,9 +74,11 @@ | ||
| 73 | 74 | if ($data->type !== 'ADDON') { |
| 74 | 75 | return; |
| 75 | 76 | } |
| 76 | 77 | |
| 78 | + // The integration has just been activated and the old addon was installed | |
| 77 | 79 | |
| 80 | + // Remove the old addon's files | |
| 78 | 81 | if (file_exists(ACYM_ADDONS_FOLDER_PATH.$plugin->name)) { |
| 79 | 82 | acym_deleteFolder(ACYM_ADDONS_FOLDER_PATH.$plugin->name); |
| 80 | 83 | } |
| 81 | 84 | } |
| @@ -105,9 +108,9 @@ | ||
| 105 | 108 | { |
| 106 | 109 | $plugin = $this->getOnePluginByFolderName($folderName); |
| 107 | 110 | if (empty($plugin)) return; |
| 108 | 111 | |
| 109 | - parent::delete($plugin->id); | |
| 112 | + parent::delete([$plugin->id]); | |
| 110 | 113 | } |
| 111 | 114 | |
| 112 | 115 | public function updateAddon(string $addon): ?int |
| 113 | 116 | { |