Skip to content

Latest commit

 

History

History
131 lines (96 loc) · 4.85 KB

Development.md

File metadata and controls

131 lines (96 loc) · 4.85 KB

Development

OpenID Connect

The OpenID Connect module is not yet officially compatible with Drupal 11, but chx/drupal-issue-fork comes to the rescue:

docker compose exec phpfpm require chx/drupal-issue-fork
docker compose exec phpfpm require composer drupal-issue-fork https://git.drupalcode.org/issue/openid_connect-3452009/-/tree/3452009-drupal-11-compatibility
docker compose exec phpfpm require composer require drupal/openid_connect:dev-3452009-drupal-11-compatibility

Local OIDC test

During (local) development we use OpenId Connect Server Mock (cf. docker-compose.oidc.yml which is included in docker-compose.override.yml).

The following users are available for local testing:

Username Password Groups
administrator administrator Administrator
editor editor Redaktoer
user user Bruger1

Masquerading

For easy user switching during testing (without access to drush user:login), the Masquerade module can be installed (composer install --dev must be run to make the module available).

A patch has been applied to allow unmasking by visiting /unmask.

WebProfiler

The WebProfiler module can be installed to help during development:

task drush -- pm:install webprofiler

The module and other development modules are excluded from configuration syncronization (cf. settings.php and https://www.drupal.org/node/3079028).

Webforms

Webforms: Forms configuration (/admin/structure/webform/config)

Custom elements

  • ai_screening_weighted_radios
  • ai_screening_weighted_textarea
  • ai_screening_weighted_textfield

Drush commands

Some helper Drush commands are added – currently most for debugging purposes:

  • task drush -- ai-screening:project-track:list: List project tracks
  • task drush -- ai-screening:project-track:show: Show details for a project track
  • task drush -- ai-screening:access-check: Show access details

Tests

We have a modules test. Run it with

task test-module-test

Development settings

The Development settings on /admin/config/development/settings (cf. https://www.drupal.org/docs/develop/development-tools/disabling-and-debugging-caching) can be set using some command line incantations:

# Disable cache
task drush -- php:eval "Drupal::keyValue('development_settings')->setMultiple(['disable_rendered_output_cache_bins' => TRUE]);"
task drush -- cache:rebuild
# Enable cache (for production)
task drush -- php:eval "Drupal::keyValue('development_settings')->setMultiple(['disable_rendered_output_cache_bins' => FALSE]);"
task drush -- cache:rebuild
# Enable Twig development mode
task drush -- php:eval "Drupal::keyValue('development_settings')->setMultiple(['twig_debug' => TRUE, 'twig_cache_disable' => TRUE]);"
task drush -- cache:rebuild
# Disable Twig development mode (for production)
task drush -- php:eval "Drupal::keyValue('development_settings')->setMultiple(['twig_debug' => FALSE, 'twig_cache_disable' => FALSE]);"
task drush -- cache:rebuild

Development command line incantations

This section contains some useful command line incantations that can come in handy during development and manual testing.

task apply-fixtures -- --yes
task drush -- sql:cli --extra=--table <<'EOF'
SELECT
  (SELECT COUNT(*) FROM project_track) AS '#project_track',
  (SELECT COUNT(*) FROM project_track_tool) AS '#project_track_tool',
  (SELECT COUNT(*) FROM webform_submission) AS '#webform_submission'
EOF

task drush -- --yes cron
task drush -- sql:cli --extra=--table <<'EOF'
SELECT
  (SELECT COUNT(*) FROM project_track) AS '#project_track',
  (SELECT COUNT(*) FROM project_track_tool) AS '#project_track_tool',
  (SELECT COUNT(*) FROM webform_submission) AS '#webform_submission'
EOF

Footnotes

  1. The "Bruger" group is not actually used in Drupal (but the AD requires a group on a user). A user that is neither an "ADministrator" or "Redaktoer" will be just an "authenticated" user.