getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

Configuration file bug #156

Closed m-schmale closed 2 years ago

m-schmale commented 2 years ago

Hi,

When I change email settings with the admin plugin a new file gets generated in this location:

/user/yyy.xxx.de/config/plugins

I have to move this file to:

/user/config/plugins

to make it work.

It's working for other plugins at the first location, so this seems to be a bug.

Regards, Mark

rhukster commented 2 years ago

Config saving is the same for all plugins, there's nothing special in email plugin. If you have an environmental config, (just the folder) the admin plugin will use that by default. It's very hard to determine what the intention would be otherwise. This has been a long-standing limitation of custom config environments and the admin plugin. That's why it's and advanced feature and typically used by developers and who are manually overriding specific items in an environment based config (like localhost) and perhaps don't push localhost config folder at all to another instance where less-technical people are using admin.

m-schmale commented 2 years ago

@rhukster If you have an environmental config, (just the folder) the admin plugin will use that by default.

Yeah, the admin plugin saves the configuration to a file in /user/yyy.xxx.de/config/plugins but it's not used by the plugin then. The values are all null. When I move this file from the environmental config to the global config it works. Could you please tell me why this is not a bug? For other plugins it's working from the environmental config folder. There aren't two config files. There's just the one file that was automatically generated by the admin plugin.

rhukster commented 2 years ago

it doesn't work when you go to https://yyy.xxx.de in your browser? What do you mean by the values are all null? If you moved null values to the user config location, then it would just pickup the values from the plugin's base config. I guess i'm confused.

m-schmale commented 2 years ago

Ah, I think I understand why it's not working. I tested it over the terminal with this command "/opt/plesk/php/7.4/bin/php bin/plugin email test-email -t mail@xxx.de". So the environmental configuration is only valid if the site is accessed over the specific address? Good to know, thanks :+1: