mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-04 08:35:31 -04:00
Plugin discovery bugfix
- Fix namespace typo causing plugin to not load - Code cleanup Signed-off-by: objec <objecttothis@gmail.com>
This commit is contained in:
1 parent
cbabe1d56c
commit
2f48e0499f
4 files changed
+6
-5
No files matched your search
@@ -32,7 +32,7 @@ class Plugins extends Secure_Controller
|
||||
$pluginData = $this->buildPluginDataArray();
|
||||
|
||||
if ($search !== '') {
|
||||
$pluginData = array_values(array_filter($pluginData, static function(array $p) use ($search): bool {
|
||||
$pluginData = array_values(array_filter($pluginData, static function (array $p) use ($search): bool {
|
||||
return str_contains(strtolower($p['name']), $search)
|
||||
|| str_contains(strtolower($p['description']), $search)
|
||||
|| str_contains(strtolower($p['id']), $search);
|
||||
@@ -41,7 +41,7 @@ class Plugins extends Secure_Controller
|
||||
|
||||
$total = count($pluginData);
|
||||
|
||||
usort($pluginData, static function(array $a, array $b) use ($sort, $order): int {
|
||||
usort($pluginData, static function (array $a, array $b) use ($sort, $order): int {
|
||||
$valA = strtolower($a[$sort] ?? $a['name']);
|
||||
$valB = strtolower($b[$sort] ?? $b['name']);
|
||||
return $order === 'asc' ? strcmp($valA, $valB) : strcmp($valB, $valA);
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Models\PluginConfig;
|
||||
use CodeIgniter\Events\Events;
|
||||
use Config\Database;
|
||||
use Config\Services;
|
||||
use Throwable;
|
||||
|
||||
class PluginManager
|
||||
{
|
||||
@@ -57,7 +58,7 @@ class PluginManager
|
||||
|
||||
try {
|
||||
$plugin = new $className();
|
||||
} catch (\Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
log_message('error', "Failed to instantiate plugin {$className}: " . $e->getMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace app\Plugins\MailchimpPlugin\Libraries;
|
||||
namespace App\Plugins\MailchimpPlugin\Libraries;
|
||||
|
||||
use CodeIgniter\Encryption\EncrypterInterface;
|
||||
use Config\Services;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace app\Plugins\MailchimpPlugin\Libraries;
|
||||
namespace App\Plugins\MailchimpPlugin\Libraries;
|
||||
|
||||
use App\Plugins\MailchimpPlugin\Enums\SubscriptionStatus;
|
||||
use Exception;
|
||||
|
||||
Reference in new issue
Block a user