aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/backend.php
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-11-08 16:49:39 +0100
committerLaria Carolin Chabowski <laria@laria.me>2020-11-08 16:52:20 +0100
commit87eb96b81c196ad3fe652128084371b4b510207e (patch)
treebea3d9bbaeb5de436c34ad068115f0bde3a5b62c /ratatoeskr/backend.php
parent4977e37c3cd61c7361692503393acd24ca521c99 (diff)
downloadratatoeskr-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.php6
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();