Closed timoschwarzer closed 4 years ago
Have you tried deleting your storage/runtime
folder?
Yes, I did a ./craft clear-caches/all
and deleted the storage/runtime
folder manually, unfortunately without success.
I suppose editing other plugins' settings is all fine? Haven't been able to immediately replicate it here, but it looks like its not resolving to the controller, instead loading the raw settings.html
file.
I wonder if you're doing anything with the usePathInfo
config setting? What's your environment setup look like?
Uhm, thanks for the hint! Actually, the settings pages of my other plugins don't work, too. I disabled all of them for now to be sure it's not one of the other plugins. My setup is like this:
The Craft project itself is in /app
in a Docker container. Container port 80 is forwarded to host port 8000 so I can access it via http://localhost:8000
.
Okay, I found the issue, though I don't understand it yet.
I have a custom module (stwon-base) in my project which adds some URL rules like this in its constructor:
Craft::$app->getUrlManager()->addRules([
'api/contact-form/locations' => 'stwon-base/contact-form/locations',
'api/contact-form/locations/<location:.+>/departments' => 'stwon-base/contact-form/departments-by-location',
'api/contact-form/submit' => 'stwon-base/contact-form/submit',
'api<x:(\/.*|)>' => 'stwon-base/api/not-found', // Catchall 404 route
'mailto' => 'stwon-base/email-obfuscation/mailto', // Email deobfuscation route
]);
What I don't understand is why this affects the plugin settings pages... Do you happen to know why this happens?
I'm not 100% certain, but I think the rule of thumb is to not call Craft::$app->getUrlManager()
directly. I think you'd be better off using some of the Craft events https://docs.craftcms.com/api/v3/craft-web-urlmanager.html#events
Hi there! Unfortunately, I cannot access the settings (
/admin/expanded-singles/settings
) page. I tried to investigate but I didn't find a solution yet. I'm sure someone knows what's happening here better than me...I'll keep investigating...
Additional info