From 0601ba1309964189f46abc9d141f6c6ca0b07053 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 23 Jan 2018 18:57:33 -0500 Subject: [PATCH 1/2] Add missing dba::inArray to Addon::reload --- src/Core/Addon.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Core/Addon.php b/src/Core/Addon.php index af3d843a9a..b1f401d28b 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -4,10 +4,9 @@ */ namespace Friendica\Core; -use Friendica\App; use Friendica\Core\Config; -use Friendica\Core\System; use Friendica\Database\DBM; + use dba; require_once 'include/dba.php'; @@ -83,7 +82,7 @@ class Addon if (strlen($addons)) { $r = dba::select('addon', [], ['installed' => 1]); if (DBM::is_result($r)) { - $installed = $r; + $installed = dba::inArray($r); } else { $installed = []; } From d6bdaeaffe2673230e02aad8ba328b6a952349c8 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 23 Jan 2018 18:57:51 -0500 Subject: [PATCH 2/2] Add update function to reload addons after hook renaming --- boot.php | 2 +- update.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 7a54f2d5a0..733bbfd6ac 100644 --- 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); /** diff --git a/update.php b/update.php index 273e75de7d..bc14b3a29f 100644 --- a/update.php +++ b/update.php @@ -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(); +}