diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-11-08 16:49:39 +0100 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-11-08 16:52:20 +0100 |
commit | 87eb96b81c196ad3fe652128084371b4b510207e (patch) | |
tree | bea3d9bbaeb5de436c34ad068115f0bde3a5b62c /ratatoeskr/backend.php | |
parent | 4977e37c3cd61c7361692503393acd24ca521c99 (diff) | |
download | ratatoeskr-cms-87eb96b81c196ad3fe652128084371b4b510207e.tar.gz ratatoeskr-cms-87eb96b81c196ad3fe652128084371b4b510207e.tar.bz2 ratatoeskr-cms-87eb96b81c196ad3fe652128084371b4b510207e.zip |
Plugin: Fix creating plugin database records
Newer MySQL / MariaDB versions are a bit more strict when omitting values
on insert which made the old Plugin::create() not work any more.
Diffstat (limited to 'ratatoeskr/backend.php')
-rw-r--r-- | ratatoeskr/backend.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index fefa817..597e1d5 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -1746,8 +1746,7 @@ function build_backend_subactions() $package = PluginPackage::load(file_get_contents($_FILES["pluginpackage"]["tmp_name"])); unlink($_FILES["pluginpackage"]["tmp_name"]); if (in_array($package->api, $api_compat)) { - $plugin = Plugin::create(); - $plugin->fill_from_pluginpackage($package); + $plugin = Plugin::create($package); $plugin->installed = false; $plugin->active = false; $plugin->save(); @@ -1798,8 +1797,7 @@ function build_backend_subactions() try { $repo = Repository::by_id($_GET["repo"]); $pkg = $repo->download_package($_GET["pkg"]); - $plugin = Plugin::create(); - $plugin->fill_from_pluginpackage($pkg); + $plugin = Plugin::create($pkg); $plugin->installed = false; $plugin->active = false; $plugin->save(); |