From 571a34822fd1d690f200062f6b6974fb4afc19d8 Mon Sep 17 00:00:00 2001 From: master3395 Date: Tue, 20 Jan 2026 01:39:35 +0100 Subject: [PATCH] Fix plugin Settings button to use main route instead of /settings/ - Change default manage_url from /plugins/{plugin}/settings/ to /plugins/{plugin}/ - Many plugins don't have a /settings/ route but have a main route - Ensures Settings button works for plugins like examplePlugin that only have a main route - Still respects settings_url and url from meta.xml if provided --- pluginHolder/views.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pluginHolder/views.py b/pluginHolder/views.py index a3e051759..07b752341 100644 --- a/pluginHolder/views.py +++ b/pluginHolder/views.py @@ -167,7 +167,11 @@ def installed(request): if plugin == 'emailMarketing': data['manage_url'] = '/emailMarketing/' elif os.path.exists(completePath): - data['manage_url'] = f'/plugins/{plugin}/settings/' + # Check if settings route exists, otherwise use main plugin URL + settings_route = f'/plugins/{plugin}/settings/' + main_route = f'/plugins/{plugin}/' + # Default to main route - most plugins have a main route even if no settings + data['manage_url'] = main_route else: data['manage_url'] = None @@ -258,8 +262,12 @@ def installed(request): data['manage_url'] = url_elem.text else: # Default to /plugins/{plugin}/ for regular plugins - # But emailMarketing is already handled above - data['manage_url'] = f'/plugins/{plugin}/' if plugin != 'emailMarketing' else '/emailMarketing/' + # Special handling for emailMarketing + if plugin == 'emailMarketing': + data['manage_url'] = '/emailMarketing/' + else: + # Default to main plugin route (most plugins work from main route) + data['manage_url'] = f'/plugins/{plugin}/' # Extract author information author_elem = root.find('author')