Closed (fixed)
Project:
Basic Ads
Version:
1.4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
10 Jul 2026 at 02:18 UTC
Updated:
25 Jul 2026 at 14:40 UTC
Jump to comment: Most recent
Basic Ads provides a settings form at /admin/config/system/basic-ads. The form saves configuration to basic_ads.settings.
The saved configuration includes:
- excluded_roles
However, the module does not provide a config/schema directory or schema for basic_ads.settings. As a result, the module's configuration cannot be fully validated by Drupal's config schema system.
1. Install Drupal 11.4.
2. Install Basic Ads.
3. Go to: /admin/config/system/basic-ads
4. Select one or more roles under "Exclude roles from tracking".
5. Save the form.
6. Run: drush config:inspect --detail --only-error
Add config schema for basic_ads.settings.
Suggested schema shape:
basic_ads.settings:
type: config_object
label: 'Basic Ads settings'
mapping:
excluded_roles:
type: sequence
label: 'Excluded roles'
sequence:
type: string
label: 'Role ID'
Comments
Comment #4
charlie59 commentedComment #5
charlie59 commentedThanks for the report — fixed and released in 1.4.4.
You were right that basic_ads.settings had no schema; while adding it I found the block settings were undescribed too, so both are now covered in config/schema/basic_ads.schema.yml:
basic_ads.settings — excluded_roles as a sequence of role IDs, marked FullyValidatable. It also ships an install default now, so the object exists on a fresh install.
block.settings.basic_ads_advertisement_block — ad_placement_term (nullable integer) and count (integer). Any site with a placed ad block would have hit the same error.
Two stored values didn't match the shape a schema describes, so they're normalised in the same change:
excluded_roles was saving the raw #type: checkboxes return value — a map keyed by role ID ({editor: editor}) — where a sequence is a list. The form re-indexes on save now. Role matching compares values rather than keys, so old and new shapes behave identically at runtime; tracking was never affected.
ad_placement_term was saving the string entity_autocomplete returns ('3'), where the schema declares an integer. The block casts on save now, and stores NULL for an empty selection.
Existing sites are covered by basic_ads_update_8006() (re-index excluded_roles) and basic_ads_update_8007() (cast settings on existing block placements). Neither changes ad selection, rendering, or tracking, though config exports will show a diff.
Comment #7
charlie59 commentedWould appreciate a confirmation from your Drupal 11.4 environment that drush config:inspect --detail --only-error comes back clean after drush updb
Comment #8
dkmishra commentedHi @charlie59, Thanks for committing the fix. I was wondering if you could consider adding issue credit for my contribution, since I reported the issue. I'd really appreciate it. Thank you!