bcgov / bcgov/GDX-Analytics-Drupal-Snowplow

Settings-overrides in settings.php are not respected

Open Beginner friendly
#32 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Configuration values are stored in `config/sync/gdx_analytics_drupal_snowplow.settings.yml`, and look like this:
```
_core:
default_config_hash: UFNo1YN6FHNzJZ0Sqq2zRrQ1yWgOyH_537Ek5qcBuqg
gdx_collector_mode: spt.apps.gov.bc.ca
gdx_analytics_snowplow_version: 1
gdx_analytics_snowplow_script_uri: 'https://www2.gov.bc.ca/StaticWebResources/static/sp/sp-2-14-0.js'
gdx_analytics_app_id: Snowplow_standalone
gdx_analytics_search_path: /search
gdx_analytics_search_key: keys
```

However, Drupal's config system is set up such that you can choose to override settings values in your site's `settings.php` file, with a line like this:
```
/**
* Snowplow override
*/
$config['gdx_analytics_drupal_snowplow.settings']['gdx_collector_mode'] = '';
```

Currently, this override mechanism is unable to work, because the settings are being retrieved using `getRawData()` rather than `get()`. I think that `getRawData()` is intended for lower-level manipulations, because it gets the data directly from the config storage system, before any overrides have been applied.

A quick search through the contrib modules installed for our current project appears to confirm this -- "get()" is generally what is used for config values retrieval.

Image

Contributor guide

Open the contributing guide

Research direction

Search the module for the configuration retrieval that currently calls getRawData(), using config/sync/gdx_analytics_drupal_snowplow.settings.yml as the setting reference. Read the surrounding configuration access and verify behavior with a settings.php override for gdx_collector_mode. Done means the override value is respected rather than the stored YAML value.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.