If I want to set mandrill api key in settings.php then the module do not get API key from settings.php value, it gets value from active config. In some we want the API key to be set in settings.php which is not supported currently. MandrillConfigurationAccessCheck checks for apikey from the database which ignores the key set in settings.php.

CommentFileSizeAuthor
#5 3152757-5.patch1.82 KBklaasvw
#2 3152757-2.patch673 byteschintan.vyas

Comments

chintan.vyas created an issue. See original summary.

chintan.vyas’s picture

StatusFileSize
new673 bytes

Adding a patch for getting overridden value of config for the mandrill API key.

johnzzon’s picture

Status: Active » Reviewed & tested by the community

Just encountered this today. We set the API key from an environment variable in settings.php:

$config['mandrill.settings']['mandrill_api_key'] = $_ENV['MANDRILL_API_KEY'];

The patch above fixes the issue. Reason is because getEditable is mutable:

Should not be used for config that will have runtime effects. Therefore it is always loaded override free.

averagejoe3000’s picture

+1 for RTBC. We've been using this patch in production for 11 months now without issue.

klaasvw’s picture

Version: 8.x-1.1 » 8.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.82 KB

We encountered a similar issue when trying to use the mandrill_template module. There were also a couple of instance there where get should be used instead of getEditable to allow settings.php overrides.

The attached patch is based on #2 with support for the mandrill_template module.

chintan.vyas’s picture

Status: Needs review » Reviewed & tested by the community

  • klaasvw authored 0517000 on 8.x-1.x
    Issue #3152757 by chintan.vyas, klaasvw: Mandrill Configuration Access...
mariacha1’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Added to the 8.x-1.x branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.