Drupal Case Studies & Practical Application 3 — Questions and Answers
Question 1: A healthcare portal requires that patient records be accessible only to the assigned care team. Which Drupal approach implements node-level access control without a custom module?
- Organic Groups (OG) module to group nodes and users (Correct answer)
- Content Translation per user
- Taxonomy access control via field permissions
- Block layout with role-based visibility
Correct answer: Organic Groups (OG) module to group nodes and users
Organic Groups lets you associate nodes with groups and restricts access so only group members can view those nodes.
Question 2: A retail client needs a faceted search experience (filter by price, brand, category) for 100,000 products. Which stack is recommended?
- Drupal Views with exposed filters backed by MySQL
- Search API module with an Apache Solr or Elasticsearch backend (Correct answer)
- Custom SQL queries with AJAX filtering
- Drupal GraphQL with client-side filtering
Correct answer: Search API module with an Apache Solr or Elasticsearch backend
Search API with a dedicated search engine backend (Solr/Elasticsearch) delivers performant faceted search at scale far better than database-backed Views.
Question 3: An agency deploys Drupal configuration between environments using config management. A developer accidentally exports config with a database credential in a YAML file. What is the correct remediation?
- Delete the YAML file and force-push to clear git history
- Move the credential to settings.php or an environment variable and remove it from git history using git filter-branch or BFG (Correct answer)
- Encrypt the YAML file with Drupal's Key module
- Rename the YAML file so it is ignored by config-import
Correct answer: Move the credential to settings.php or an environment variable and remove it from git history using git filter-branch or BFG
Credentials must be removed from all git history using a history-rewriting tool and relocated to settings.php or environment variables outside version control.
Question 4: A publishing site uses Drupal's Content Moderation module. An editor complains that published articles revert to 'Draft' when revised. What is the likely cause?
- The workflow is missing a 'Published (revised)' state that keeps content live while a new draft exists (Correct answer)
- The node's 'Published' checkbox is unchecked by default
- Content Moderation is incompatible with the active theme
- The editor lacks the 'administer nodes' permission
Correct answer: The workflow is missing a 'Published (revised)' state that keeps content live while a new draft exists
Without an intermediate state like 'Published (revised)', saving a revision of a live node moves it back to Draft; the workflow must include a state that marks the latest revision as published.
Question 5: A news site's editorial team uses Layout Builder to customize article pages but changes made to the article content type's default layout are not reflected on existing nodes. Why?
- Layout Builder requires clearing the Twig cache after layout changes
- Existing nodes have overrides stored per-entity that take precedence over the content type default layout (Correct answer)
- The Layout Builder module must be reinstalled to propagate changes
- Display modes must be resaved to update existing content
Correct answer: Existing nodes have overrides stored per-entity that take precedence over the content type default layout
When editors enable per-entity overrides in Layout Builder, each node stores its own layout configuration which overrides the content type default.
Question 6: A Drupal site integrated with Salesforce CRM needs to push a lead record every time a webform submission is saved. Which approach follows Drupal best practices?
- Write a cron job that queries new webform submissions and calls the Salesforce API
- Implement hook_webform_submission_insert() to trigger a Salesforce API call synchronously
- Use the Salesforce Suite module's mapping to sync webform submissions via queue (Correct answer)
- Poll the Salesforce API from the frontend JavaScript on form submit
Correct answer: Use the Salesforce Suite module's mapping to sync webform submissions via queue
The Salesforce Suite module handles object mapping and pushes data via Drupal's Queue API, decoupling the sync from the user's request so failures don't break submissions.
Question 7: A site owner reports that after enabling Drupal's Aggregation for CSS and JavaScript, the site theme broke for some users. What is the most likely cause?
- The server's PHP version is incompatible with aggregation
- Cached aggregated files contain paths relative to an incorrect base URL or CDN (Correct answer)
- Aggregation removes Drupal's critical CSS needed for the admin toolbar
- The theme uses conditional comments not supported by aggregation
Correct answer: Cached aggregated files contain paths relative to an incorrect base URL or CDN
Aggregated CSS files may contain relative paths to assets (fonts, images) that break when the aggregated file's URL differs from the original, particularly with CDN or subdirectory installs.
A healthcare portal requires that patient records be accessible only to the assigned care team.
Which Drupal approach implements node-level access control without a custom module?