mirror of
https://github.com/pelican-dev/panel.git
synced 2025-12-24 11:54:04 +01:00
Fix plugin settings not showing on non-admin plugins (#2023)
This commit is contained in:
parent
1d5ace3a6d
commit
fef91791c3
@ -306,11 +306,10 @@ class Plugin extends Model implements HasPluginSettings
|
||||
public function hasSettings(): bool
|
||||
{
|
||||
try {
|
||||
$pluginObject = filament($this->id);
|
||||
$pluginObject = new ($this->fullClass());
|
||||
|
||||
return $pluginObject instanceof HasPluginSettings;
|
||||
} catch (Exception) {
|
||||
// Plugin is not loaded on the current panel, so no settings
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -320,13 +319,12 @@ class Plugin extends Model implements HasPluginSettings
|
||||
public function getSettingsForm(): array
|
||||
{
|
||||
try {
|
||||
$pluginObject = filament($this->id);
|
||||
$pluginObject = new ($this->fullClass());
|
||||
|
||||
if ($pluginObject instanceof HasPluginSettings) {
|
||||
return $pluginObject->getSettingsForm();
|
||||
}
|
||||
} catch (Exception) {
|
||||
// Plugin is not loaded on the current panel, so no settings
|
||||
}
|
||||
|
||||
return [];
|
||||
@ -336,13 +334,12 @@ class Plugin extends Model implements HasPluginSettings
|
||||
public function saveSettings(array $data): void
|
||||
{
|
||||
try {
|
||||
$pluginObject = filament($this->id);
|
||||
$pluginObject = new ($this->fullClass());
|
||||
|
||||
if ($pluginObject instanceof HasPluginSettings) {
|
||||
$pluginObject->saveSettings($data);
|
||||
}
|
||||
} catch (Exception) {
|
||||
// Plugin is not loaded on the current panel, so no settings
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user