Drupal Case Studies & Practical Application 2 — Questions and Answers
Question 1: A university needs a portal where students log in and see personalized course materials while anonymous visitors see only public content. Which Drupal feature best addresses this?
- Field API with per-field permissions
- Content Access module with role-based visibility
- Views with contextual filters and user role conditions (Correct answer)
- Panelizer with user-specific panel variants
Correct answer: Views with contextual filters and user role conditions
Views with contextual filters and role-based access conditions lets you serve different content sets to authenticated vs. anonymous users from the same view.
Question 2: A nonprofit migrates 50,000 legacy records into Drupal 10 from a CSV export. Which tool is most appropriate for a one-time bulk migration?
- Feeds module
- Drupal Migrate API with a CSV source plugin (Correct answer)
- REST API with a custom import script
- Content staging via Drush config-import
Correct answer: Drupal Migrate API with a CSV source plugin
The Drupal Migrate API with a CSV source plugin is designed for structured one-time or repeatable data migrations with full rollback support.
Question 3: An e-commerce client reports that product pages load slowly due to expensive taxonomy queries. After profiling, you confirm the bottleneck. What is the first Drupal-native remediation to apply?
- Switch the database to MongoDB
- Enable Internal Page Cache and Dynamic Page Cache modules (Correct answer)
- Rewrite the taxonomy module's SQL in custom code
- Increase PHP memory_limit in php.ini
Correct answer: Enable Internal Page Cache and Dynamic Page Cache modules
Enabling Internal Page Cache and Dynamic Page Cache is the first-line Drupal-native optimization that caches rendered pages and personalized page sections without code changes.
Question 4: A media company wants editors to schedule content to publish automatically at a future date. Which Drupal core feature or module handles this?
- Scheduler module (Correct answer)
- Content Moderation with a 'scheduled' state
- Rules module with a cron event
- Publishing Options fieldset with a date widget
Correct answer: Scheduler module
The Scheduler module (widely used contrib) allows editors to set a publish-on date and unpublish-on date per node.
Question 5: A government site must comply with WCAG 2.1 AA. An audit flags missing alt text on user-uploaded images. How should you enforce this in Drupal?
- Add a custom validation hook in a .module file to require alt text on the image field
- Set the image field's 'Required alternate text' setting to enabled in the field configuration (Correct answer)
- Install the Accessibility Scanner module to auto-generate alt text
- Use JavaScript to warn editors after upload
Correct answer: Set the image field's 'Required alternate text' setting to enabled in the field configuration
Drupal's core Image field has a built-in 'Required alternate text' toggle in field settings that forces editors to enter alt text before saving.
Question 6: A SaaS company runs multiple brand sites from a single Drupal codebase. Which Drupal architecture pattern best supports this?
- Domain Access module on a single-site install
- Drupal Multisite with shared core and separate databases (Correct answer)
- One Drupal install per brand behind a reverse proxy
- Content Translation module with one domain per language
Correct answer: Drupal Multisite with shared core and separate databases
Drupal Multisite shares one codebase and one core installation while each site has its own database, files directory, and settings.php.
Question 7: During a content audit, you discover 200 nodes use a text format that allows raw PHP execution (PHP filter). What is the recommended remediation?
- Restrict the PHP filter role permission to administrators only
- Disable and uninstall the PHP filter module, converting nodes to a safe format (Correct answer)
- Add a CSP header to block PHP output in the browser
- Enable Twig's auto-escaping to sanitize PHP output
Correct answer: Disable and uninstall the PHP filter module, converting nodes to a safe format
The PHP filter module is a critical security risk; the recommended action is to disable and uninstall it and migrate content to a safe text format like Basic HTML.
A university needs a portal where students log in and see personalized course materials while anonymous visitors see only public content.
Which Drupal feature best addresses this?