Drupal Technology & Digital Applications 4 — Questions and Answers
Question 1: What is Drupal's 'Paragraphs' contributed module primarily used for?
- Auto-generating meta descriptions
- Creating flexible, component-based content structures within a node (Correct answer)
- Managing multi-paragraph text with WYSIWYG
- Splitting articles into paginated sections
Correct answer: Creating flexible, component-based content structures within a node
The Paragraphs module allows content editors to build pages from reusable, configurable content components (paragraphs) such as text blocks, image galleries, or CTAs.
Question 2: In Drupal, what does 'cache tags' invalidation allow?
- Deleting all cache bins at once
- Selectively clearing only the cached pages affected by a specific piece of content (Correct answer)
- Tagging content for SEO optimization
- Marking cache entries for manual review
Correct answer: Selectively clearing only the cached pages affected by a specific piece of content
Cache tags let Drupal track which cached responses depend on specific data, so when that data changes only the relevant cached pages are invalidated rather than the entire cache.
Question 3: Which Drupal module type would you implement to add a custom source plugin for the Migrate framework?
- A custom block module
- A custom module with a Plugin class in the MigrateSource plugin namespace (Correct answer)
- A custom theme with migrate.yml
- A custom field type module
Correct answer: A custom module with a Plugin class in the MigrateSource plugin namespace
To add a custom migration source, you create a custom module with a PHP class annotated with `@MigrateSource` placed in the `Plugin/migrate/source/` directory.
Question 4: What is the purpose of Drupal's 'Media Library' module?
- To embed YouTube videos via oEmbed only
- To provide a centralized, reusable asset management interface for media items (Correct answer)
- To compress images automatically on upload
- To serve media files through a CDN
Correct answer: To provide a centralized, reusable asset management interface for media items
The Media Library module provides a UI for managing reusable media assets (images, videos, documents) that can be referenced across multiple pieces of content.
Question 5: In Drupal development, what does the 'hook_update_N()' function accomplish?
- Updates the Drupal core version
- Runs one-time database schema or data migrations when a module is updated (Correct answer)
- Forces all caches to rebuild
- Notifies users of available module updates
Correct answer: Runs one-time database schema or data migrations when a module is updated
Hook_update_N() functions contain update tasks run once during `drush updb` to perform database schema changes or data transformations when a module version increments.
Question 6: Which Drupal core module enables multi-step editorial workflows with role-based content state transitions?
- Workbench Moderation (contrib)
- Content Moderation (core) (Correct answer)
- Workflow (core)
- Publishing States (contrib)
Correct answer: Content Moderation (core)
Content Moderation, a Drupal core module, allows defining workflow states (like Draft, Review, Published) and controlling which roles can transition content between those states.
Question 7: What is the role of Drupal's 'Inline Form Errors' module?
- Preventing form submissions via AJAX
- Displaying validation error messages directly next to the relevant form fields (Correct answer)
- Adding CAPTCHA challenges to forms
- Pre-filling form fields from user profile data
Correct answer: Displaying validation error messages directly next to the relevant form fields
The Inline Form Errors module moves validation error messages from the top summary to display inline next to the form field that caused the error, improving usability.
What is Drupal's 'Paragraphs' contributed module primarily used for?