]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #4318 from MrPetovan/bug/4314-fix-addon-reload
authorMichael Vogel <icarus@dabo.de>
Wed, 24 Jan 2018 00:08:11 +0000 (01:08 +0100)
committerGitHub <noreply@github.com>
Wed, 24 Jan 2018 00:08:11 +0000 (01:08 +0100)
Fix addon reload

boot.php
src/Core/Addon.php
update.php

index 7a54f2d5a08169015072e5f1d86e3c4b68e23e61..733bbfd6ac49d63ec001499ec781dd4957e0dbef 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -41,7 +41,7 @@ define('FRIENDICA_PLATFORM',     'Friendica');
 define('FRIENDICA_CODENAME',     'Asparagus');
 define('FRIENDICA_VERSION',      '3.6-dev');
 define('DFRN_PROTOCOL_VERSION',  '2.23');
-define('DB_UPDATE_VERSION',      1246);
+define('DB_UPDATE_VERSION',      1247);
 define('NEW_UPDATE_ROUTINE_VERSION', 1170);
 
 /**
index af3d843a9ad79bca639148d8b5ec36095285eac3..b1f401d28b42aaac2bdb19ce9c7ffa70318b777a 100644 (file)
@@ -4,10 +4,9 @@
  */\r
 namespace Friendica\Core;\r
 \r
-use Friendica\App;\r
 use Friendica\Core\Config;\r
-use Friendica\Core\System;\r
 use Friendica\Database\DBM;\r
+\r
 use dba;\r
 \r
 require_once 'include/dba.php';\r
@@ -83,7 +82,7 @@ class Addon
                if (strlen($addons)) {\r
                        $r = dba::select('addon', [], ['installed' => 1]);\r
                        if (DBM::is_result($r)) {\r
-                               $installed = $r;\r
+                               $installed = dba::inArray($r);\r
                        } else {\r
                                $installed = [];\r
                        }\r
index 273e75de7d53bccc84e49a548245120b731ca3f1..bc14b3a29fbbca7b2a317d8d5a9a8fa3baced7ea 100644 (file)
@@ -7,6 +7,8 @@ use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 use Friendica\Model\User;
 
+require_once 'include/dba.php';
+
 /**
  *
  * update.php - automatic system update
@@ -173,3 +175,12 @@ function update_1245() {
 
        return UPDATE_SUCCESS;
 }
+
+function update_1247() {
+       // Removing hooks with the old name
+       dba::e("DELETE FROM `hook`
+WHERE `hook` LIKE 'plugin_%'");
+
+       // Make sure we install the new renamed ones
+       Addon::reload();
+}