After module installation I can't set both the "SMTP Port" and "Use encrypted protocol" fields because they are disabled.

The warning "Disabled fields are overridden in site-specific configuration file" is shown on the page (before and after module activation).

I've tried both with and without the patch "0001-Issue-2819793-Can-t-send-mail-Non-existent-service-s.patch" which is not included in the beta1.

I've got a multilanguage site with D8.2.2. No error messages in the logs.

In another instance I've got this module fine with the SMTP module patched. I really need to enable it in this one.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

@baux created an issue. See original summary.

@baux’s picture

I've tried to install old versions from backups, and I can configure these parameters if the multilanguage modules are not installed on the site...

After some investigation I've seen that the issue is available just if I change the "Selected language" in "Detection and selection" from "Site's default language (English)" to another one (e.g. "Spanish"). If I come back to "Site's default language (English)" I can properly configure the module, and (finally) if I change to Spanish, I can still send mails and have the right configuration of the site.

These are the steps to manually correct the problems (if someone needs this configuration), but I think that the bug should be correct in the code.

Thanks in advance

tuhongwei’s picture

I have the same problem
SMTP module is INACTIVE.
Disabled fields are overridden in site-specific configuration file.

tuhongwei’s picture

Assigned: Unassigned » tuhongwei
Status: Active » Needs work

SMTP module is active.
Disabled fields are overridden in site-specific configuration file.

labboy0276’s picture

I am still getting this error even after trying the solution in #2.

arnoldbird’s picture

Version: 8.x-1.x-dev » 8.x-1.0-beta2

I'm seeing this issue in the beta2 release. I don't know what multilanguage modules @baux is referring to in #2. I don't have any such modules installed. My install is fairly recent and I don't have a lot of contributed modules installed.

arnoldbird’s picture

Version: 8.x-1.0-beta2 » 8.x-1.x-dev

Changing the version back to the dev branch because the issue I'm seeing is much more minor. I am seeing the "Disabled fields are overridden" message but no fields are actually disabled in my case. In fact there don't seem to be any problems with the module at all in my case, other than the appearance of this message. In my case this is a minor bug.

@baux’s picture

@arnoldbird: I'm talking about core multilanguage modules. I've got a site with 2 languages (english and spanish) and the problem disappeared when changed the config such as in #2. The problem is that after this change I've seen some major problems in the site...

I really need to send mail for this site... If not possible with this module, someone knows how to do it in another way?

TIA

@baux’s picture

A few ways to temporary solve this problem...

Surfing the Drupal database I found 2 fields that contains the smtp.config in the config table: the first related to the default configuration, and second one to the spanish language.

The Spanish view is the default and I was accessing to the SMTP configuration using the Spanish language. Access to the configuration to the English view (SITE/en/...) shows all fields enabled and the configuration can be properly edited.

By the way, the message "Disabled fields are overridden in site-specific configuration file." still appears in both views.

I've tried to delete the registry associated with the Spanish lang in the database; after that, it's possible to edit the configuration also in the Spanish view (but I still have the message).

In the Spanish data file containing the configuration I notice the following:

a:3:{s:9:"smtp_port";s:3:"465";s:13:"smtp_protocol";s:9:"estándar";s:16:"prev_mail_system";s:8:"php_mail";}

Probably the system has translated and stored the "standard" word to Spanish. the "s:9" indicates that this word in long 9 bytes (2 bytes for the "á" char)... changing "smtp_protocol";s:9:"estándar" to "smtp_protocol";s:8:"standard" or "smtp_protocol";s:3:"ssl" should works too...

Remember to flush all caches after that...

The problem have to be changed in the installation process... my point of view is that these values have not to be modified in different languages and it should be configured once per site, and as I mention before, the message is still displayed.

apermuy’s picture

SMTP woks fine for me in this context: Drupal core: 8.2.7 with Galician language as default site language , Mail System 8-x.4.1 and SMTP 8.x-1.0-beta2+5-dev running in a Ubuntu 16.04.02 server with PHP version 7.0.15 and using Mailjet as mail provider. Remarks about my configuration:

  • Send a test email through gl/admin/config/system/smtp show "Disabled fields are overridden in site-specific configuration file." message but emails working fine at least using contact form.
  • Mail format despite of being configured as formatted HTML don't show with desired format.
  • I have configured Mail System module with this params : Formatter=> Mail collector, Sender => SMTP Mailer
pnagornyak’s picture

The problem is in smtp.schema.yml, if you don`t need different configuration for each language please check related issue.

estoyausente’s picture

@pnagornyak are right, the problem is in the schema, the config fields are configured as a text in place of string, the issue is resolved here:
https://www.drupal.org/node/2865696

but the patch is not commited yet. Can you test with this patch and tell us if your module works with it?

hungry_mind’s picture

I've got the same problem with disabled fields being 'SMTP port' and 'Use encrypted protocol', in a 8.3.7 bi-lingual site. Although the SMTP module is active, emails cannot be sent via the contact form.

I applied the patch manually (converting the required 'text' fields to 'string'), I uninstalled the SMTP module and re-installed it and finally I was able to edit the SMTP port (still getting the "Disabled fields are overridden in site-specific configuration file." message).

Nevertheless, the site still is unable to send email via the contact form, using the SMTP mod.

Has there been any solution lately?

estoyausente’s picture

@hungry_mind Are you using the latest dev version or the beta-3?

hungry_mind’s picture

I am using the smtp 8.x-1.0-beta3 version.

estoyausente’s picture

Please use the last dev version. As you can see, SMTP for D8 are under development and a stable version is not release yet. I'm using the last version and I don't have problem sending mails in two languages :S

(And please, stop editing your comments when you already have an answers, I could see three different versions of your comment and is a little bit difficult follow the thread. I suggest you in this kind of cases create another comment with the extra information.)

Regards!

hungry_mind’s picture

@estoyausente, thank you for the tip.

I tried to uninstall the module, the software reports that it was uninstalled, but I still see it listed in the modules list, so it is only disabled. When I try to install the dev version, I get the message that the SMTP module is already installed. I tried to rename the 'public_html/modules/smtp' folder with no result. I have also cleared the cache, but again, no result.

How could I get rid of the smtp module completely? It seems a really buggy module, it cannot be uninstalled either.......

estoyausente’s picture

but I still see it listed in the modules list, so it is only disabled

D8 doesn't have a disable mode. I think that you can try:

  • Put the beta3 version (or the version that you had before upgrade).
  • Uninstall SMTP
  • If module still available, you may try to remove directly in the database
  • Update the module code to the last dev version
  • enlable it

I had problem once when I try to uninstall a module when the install code has been changed. Drupal try to remove a field that "X" type but the current field type is "Y" and the uninstall process finished with error. In this case I had to change my code to the last version, uninstall it and them install again.

Another action that you can try is execute drush entity-updates to update the schema before uninstall it (or maybe with this you won't have to uninstall...).

hungry_mind’s picture

@estoyausente, you wrote:

1. Put the beta3 version (or the version that you had before upgrade).

2. Uninstall SMTP

3. If module still available, you may try to remove directly in the database

4. Update the module code to the last dev version

5. enlable it

Regarding the 1st step, I have already had the beta3 version installed, that's why I want to uninstall it.
Regarding the 2nd step, that is my problem. I cannot uninstall it. Module still exists in the modules list, without the 'Configure' option.
Regarding the 3rd step, how do I remove it from the database? Which table/tables, which row/rows? Are there any guidelines concerning it's database locations?

Mahima Prachandia’s picture

I was also facing the same issue for my multi-lingual site. I did following steps :
1) I just uninstalled it via drush :
drush pm-uninstall smtp

2) Then I updated the module.
3) Then I applied the patch smtp-disabled-fields-overridden-site-specific-2826189-20-d8.patch
4) Install the module.
5) Cleared the cache by drush cr
6) Configure the SMTP module for the non-default language (fr).
7) Then I configured the module for the default language (en).
8) Sent a test mail in both the language.
Its working fine !

Thanks,

hungry_mind’s picture

Mahima Prachandia, thanks for the tips, but I am still having the same problem - after having executed the drush command which reports the module as uninstalled, the module is still listed in the modules list, (without the 'Configure' link, ie, it is inactivated, but not removed from the database, it seems).

Also, I have a question, regarding the 2nd step in your procedure. Since the module is uninstalled in the 1st step, how can it be updated in the 2nd step? Would you mean installing the dev version?

slydevil’s picture

I think the answer is to remove the disabling of fields altogether. The method of notifying the user of config overrides has been discussed at length here: https://www.drupal.org/project/drupal/issues/2408549. There are patches to apply to enable the notification of overridden config values.

I've attached a new patch, which removes the isOverridden function and all checks made by it.

slydevil’s picture

Hiding the other patch, since it actually for another issue.

SivaprasadC’s picture

@slydevil

Thanks for the patch. The patch is not applying for 8.x-1.0-beta4. So, I have re-rolled the patch. PFA

This patch helps me to solve the warning.

slydevil’s picture

Chris Matthews’s picture

Assigned: tuhongwei » Unassigned
Status: Needs review » Needs work
Issue tags: +Needs reroll

The patch in #24 does not apply to 8.x-1.x-dev.

jedsaet’s picture

Re-rolled against dev.

wundo’s picture

Status: Needs review » Needs work

Test is failing

wundo’s picture

wundo’s picture

kpoornima’s picture

Assigned: Unassigned » kpoornima
Status: Needs work » Needs review
FileSize
7.47 KB

Re-rolled against dev (8.x-1.x-dev.).

tiikeri’s picture

Good news SMTP users: I applied the #31 patch and it works! ;-)

Be more specific: I have a multilanguage drupal 8.8 site on PHP 7.3 and MariaDB 5.5 on Apache 2.4 and incurred in the same warning as other "Disabled fields are overridden in site-specific configuration file" and couldn't send e-mails. After applying the patch, I send a test e-mail and received it.

Thank you guys, you're awesome.

lolandese’s picture

Posting a link to a change record introduced in Drupal core 8.5.0. Seems related and might impact the chosen solution.

New method \Drupal\Core\Config\Config::hasOverrides($key) determines if a configuration object or any of its keys are overridden | Drupal.org

The issue title is a bit confusing, just being the warning shown. That seems like expected behaviour, looking at:

    $this->messenger->addMessage($this->t('Disabled fields are overridden in site-specific configuration file.'), 'warning');

That is called in any case, not being wrapped in a conditional. So, it is always shown. Based just on that, I would say the issue would qualify for a 'Closed (works as designed)' status. If not, the issue title and description should be adjusted to better describe the experienced issue.

In any case, the module's function isOverridden($name) could now be replaced by Drupal core's hasOverrides($key), as mentioned in the change record, but that would probably justify a new issue.

justkristin’s picture

Sorry, all -

Am trying to get the 8.x-1.0-rc4 version patched (on D8.9.2) but only some of the hunks are caught:

knielsen@gossamer ~/Desktop/smtp $ patch -p1 < removed_config_override_logic-re-rolled-2826189-31.patch
patching file src/Form/SMTPConfigForm.php
Hunk #1 FAILED at 63.
Hunk #2 FAILED at 74.
Hunk #3 succeeded at 152 (offset 67 lines).
Hunk #4 succeeded at 167 (offset 67 lines).
Hunk #5 succeeded at 192 with fuzz 1 (offset 67 lines).
Hunk #6 succeeded at 224 (offset 86 lines).
Hunk #7 succeeded at 242 (offset 86 lines).
Hunk #8 succeeded at 249 with fuzz 2 (offset 86 lines).
Hunk #9 succeeded at 268 (offset 86 lines).
Hunk #10 FAILED at 293.
Hunk #11 FAILED at 346.
Hunk #12 succeeded at 380 with fuzz 1 (offset 102 lines).
4 out of 12 hunks FAILED -- saving rejects to file src/Form/SMTPConfigForm.php.rej

I can't fix the email problem our site is currently having - looks like the update I did to the module 4 days ago killed settings? At any rate, how do I fix things from here? Sorry!

justkristin’s picture

All -
I have created a patch based on the one in #31, but made diffed against smtp-8.x-1.0-rc4. It worked without missed chunks.

justkristin’s picture

justkristin’s picture

Ok. Final version. Found a problem with another paren. I swear. Installed and working, for me, tho.

slydevil’s picture

#37 does not apply to rc4 for some reason:

$ composer install
  - Removing drupal/smtp (1.0.0-rc4)
Gathering patches for root package.
Removing package drupal/smtp so that it can be re-installed and re-patched.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Deleting web/modules/contrib/smtp - deleted
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/smtp (1.0.0-rc4): Loading from cache
  - Applying patches for drupal/smtp
    https://www.drupal.org/files/issues/2020-08-05/removed_config_override_logic-re-rolled-2826189-37.patch ('Disabled fields are overridden in site-specific configuration file' Warning)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-08-05/removed_config_override_logic-re-rolled-2826189-37.patch

Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Generating autoload files
  * Homepage: https://www.drupal.org/project/drupal
  * Support:
    * docs: https://www.drupal.org/docs/user_guide/en/index.html
    * chat: https://www.drupal.org/node/314178
Pene’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll +Needs merge

RTBC - The "Disabled fields are overridden in site-specific configuration file" warning disappeared with #39 - So it works with Drupal 9.3.2 (minimal profile) + smtp 8.x-1.0

I'm also able to edit "both the "SMTP Port" and "Use encrypted protocol" fields".

lhridley’s picture

Status: Reviewed & tested by the community » Needs work

Setting this back to "Needs Work" because:

Overriding configuration in settings.php should present a message to the user that "disabled fields are overridden in site-specific configuration file", and the overridden fields should be disabled as an indicator to the user that these values need to be adjusted in settings.php instead of through the Admin UI. This is standard behavior Drupal expected behavior.

Applying this patch when settings are actually overridden in settings.php does not apply a visual indicator, leaving a user to think that configuration values presented through the Admin UI can actually be overridden in that manner, when in actuality they cannot.

Tested using Drupal 9.3.3, with module version 8.x-1.0 and patch applied and multilingual support enabled, with config values overridden in settings.php.

xjm’s picture

Issue tags: -Needs merge

 

Qusai Taha’s picture

FileSize
7.18 KB

Re-roll with the latest version

proweb.ua’s picture

#46
8.x-1.2 and last dev
Could not apply patch! Skipping. The error was: Cannot apply patch

Qusai Taha’s picture

Status: Needs work » Needs review
FileSize
7.37 KB

Re-roll the patch

Status: Needs review » Needs work

The last submitted patch, 47: 2826189-47.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Qusai Taha’s picture

FileSize
8.98 KB
xeM8VfDh’s picture

I just installed version 8.x-1.2 on Drupal 10.2.1

I configured it and the test email worked, hooray!

But I do see this "Disabled fields are overridden in site-specific configuration file" message at the top of the config page and have no idea what it means or if I should ignore it.