itk-dev/tidy-feedback

Tidy feedback

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 3

Type:drupal-module

dev-main 2025-07-04 07:12 UTC

This package is auto-updated.

Last update: 2025-07-04 11:50:38 UTC


README

This is a Drupal module and a Symfony bundle to collection user feedback.

Caution

The documentation is incomplete!

Installation

composer require itk-dev/tidy-feedback:dev-main

Important

You may have to add --with-all-dependencies to the composer require command to make everything fall into place.

Drupal

drush pm:install tidy_feedback
drush tidy-feedback:doctrine:schema-update

Symfony

Create config/routes/tidy_feedback.yaml:

#config/routes/tidy_feedback.yaml
tidy_feedback:
  resource: "@TidyFeedbackBundle/config/routes.php"
  prefix: /tidy-feedback

Note

You can use any prefix, but for consistency with the Drupal version of Tidy feedback you should use /tidy-feedback.

If Symfony Flex hasn't already done so, you must enable the TidyFeedbackBundle bundle:

// config/bundles.php
return [
    …,
    ItkDev\TidyFeedbackBundle\TidyFeedbackBundle::class => ['all' => true],
];
bin/console tidy-feedback:doctrine:schema-update

Configuration

We need a Doctrine database URL in the environment variable TIDY_FEEDBACK_DATABASE_URL, e.g.

# .env
# See https://www.doctrine-project.org/projects/doctrine-dbal/en/4.2/reference/configuration.html#connecting-using-a-url for details.
TIDY_FEEDBACK_DATABASE_URL="pdo-sqlite:////app/tidy-feedback.sqlite"

As an alternative for Drupal you can set TIDY_FEEDBACK_DATABASE_URL in settings.local.php:

# web/sites/default/settings.local.php
putenv('TIDY_FEEDBACK_DATABASE_URL=pdo-sqlite:////app/tidy-feedback.sqlite');

TIDY_FEEDBACK_USERS='{"admin": "password"}'

After installation and configuration, open /tidy-feedback/test on your site and enjoy!

All feedback items can be found on /tidy-feedback.

Development

task

composer.json

In order to make this behave as both a Drupal module and a Synfony bundle, we use some tricks in composer.json:

{
    // We use "type": "drupal-module" to make Drupal move the module into the
    // proper location (web/modules/contrib).
    // Symfony recommend using "type": "drupal-module" (cf. https://symfony.com/doc/current/bundles/best_practices.html#installation),
    // but Symfony and Flex don't seem to really care about this.
    "type": "drupal-module",
    "require": {
        // In order to not pull much of Symfony into a Drupal project or (worse)
        // much of Drupal into a Symfony project, we require only the bare
        // minimum to make this module/bundle work.
        "doctrine/dbal": "^3 || ^4",
        "doctrine/orm": "^2.8 || ^3",
        "symfony/cache": "^6 || ^7",
        "twig/twig": "^3"
    },
    "autoload": {
        "psr-4": {
            // The Symfony bundle namespace.
            "ItkDev\\TidyFeedbackBundle\\": "symfony/src/",
            // The shared code namespace.
            "ItkDev\\TidyFeedback\\": "src/"
        }
    },
    // …
}

Twig

We use a watered-down instance of Twig with only a trans filter and a path function.