/os2forms

Provides advanced webform functionality for Danish Municipalities.

Primary LanguagePHP

OS2Forms Drupal module Build Status

Install

OS2Forms Drupal 8 module is available to download via composer.

composer require os2forms/os2forms
drush en os2forms

If you don't have Drupal installed on you server, you will to need install it first. Read more about how to install drupal core.

We are recommending to install drupal via composer by using OS2Forms composer project. By this way you will get standalone project with OS2Forms module on board, plus all the other contrib modules you will probably need to configure OS2Forms to your specific demands.

composer create-project os2forms/composer-project:8.x-dev some-dir --no-interaction

To get more benefits on your Drupal project we are offering you to use OS2web as installation profile for Drupal. This profile is a part of OS2Forms composer project mentioned above.

You can easy download and install OS2web installation profile to your composer based Drupal project with commands:

composer require os2web/os2web
drush si os2web --db-url=mysql://db_user:db_pass@mysql_host/db_name --locale=da --site-name="OS2Forms" --account-pass=admin -y

Update

Updating process for OS2forms module is similar to usual Drupal 8 module. Use Composer's built-in command for listing packages that have updates available:

composer outdated os2forms/os2forms

Automated testing and code quality

See OS2Forms testing and CI information

Contribution

OS2Forms project is opened for new features and os course bugfixes. If you have any suggestion or you found a bug in project, you are very welcome to create an issue in github repository issue tracker. For issue description there is expected that you will provide clear and sufficient information about your feature request or bug report.

Code review policy

See OS2Forms code review policy

Git name convention

See OS2Forms git name convention

Important notes

Webforms

Each webform, including all its settings, is stored as configuration in db and will(could) be exported as yml file via Drupal configuration management system. And afterwards could be tracked by git.

It means that all webform settings from drupal database will be syncronized (exported/imported) with state stored in yml files from configuration folder stored in git repository. Without proper actions webforms could be deleted or reverted to state in yml during synchronization.

To avoid/prevent this behavior we recommend use Config ignore module, where you can add all settings you do not want to export/import via configuration management system.

Serviceplatformen plugins

Settings for CPR and CVR serviceplantormen plugins are storing as configuration in db and will(could) be exported as yml file via Drupal configuration management system. And afterwards could be tracked by git.

If case you have public access to your git repository all setting from plugins will be exposed for third persons.

To avoid/prevent this behavior we recommend use Config ignore module, where you can add all settings you do not want to export/import via configuration management system.

Unstable features

Export submissions to Word

This feature is still not part of Webform and Entity print modules stable versions due to following issues:

To get this functionality on drupal project there will be applied patches from issues above via Composer.

NOTE: If you are downloading os2forms module without using composer, be aware that you have apply those patches by yourself.

Coding standards

Our coding are checked by GitHub Actions (cf. .github/workflows/pr.yml). Use the commands below to run the checks locally.

PHP

docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer install
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer coding-standards-check

# Fix (some) coding standards issues.
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer coding-standards-apply

Markdown

docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn install
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-check/markdownlint

# Fix (some) coding standards issues.
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-apply/markdownlint

Code analysis

We use PHPStan for static code analysis.

Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the analysis:

./scripts/code-analysis