-
Notifications
You must be signed in to change notification settings - Fork 1
Backends customization workflow
- Custom Drupal modules can be added under
backend-donations
andbackend-gifts
services. - Custom Drupal modules must be added under
web/modules/custom/
directory of backend services.
- Go to project's root directory.
- Run
docker-compose exec be_donations ./vendor/bin/drupal generate:module --module-path="modules/custom"
and follow the interactive prompt.
- Go to project's root directory.
- Run
docker-compose exec be_gifts ./vendor/bin/drupal generate:module --module-path="modules/custom"
and follow the interactive prompt.
Drupal console documentation can be checked here
NOTE: This not yet tested, if it works we will document exact steps how to use it:
Composer Merge Plugin might solve managing contributed module dependencies in child repos by adding something like composer.local.json
or any custom name. So developers in child repo won't conflict with Falcon's composer.json file.
Falcon related modules reside in modules/falcon
directory and developer must never edit and customize code in it. All Falcon related modules provide (should be providing) standard Drupal API ways of overriding existing functionality, logic or features.
- Find the piece of code you would like to alter under
modules/falcon
directory. - Identify how it is implemented and find relevant ways to override/alter the implementation.
- Create new or edit existing custom Drupal module under
modules/custom
directory to override and implement your custom implementation of existing Falcon code.
Also there are many ways to override existing Drupal module implementations, here is short list of common APIs used to override different parts of the system:
- Altering existing services, providing dynamic services
- Altering existing routes and adding new routes based on dynamic ones
- Hooks API
All Falcon based projects might have different configurations and in order to manage those configurations and prevent conflicting with Falcon's default configuration all developers should use config_split module. Config split module gives us ability to define custom/project specific configurations and export/import them safely.
Important NOTE: in order to manage core.extension
config properly please see next section as it is different process.
When project specific configuration modification or customization is needed developers must:
- Make those changes in a regular way.
- Go to config_split configuration page
/admin/config/development/configuration/config-split
and edit Customizations split settings. - Grey-list: choose your project specific custom config keys under CONDITIONAL SPLIT section and save.
- Export config using Drush
docker-compose exec {container_name} drush config-export --root=/var/www/html/web
.
This way you custom changes will be exported under config/customizations
folder and Falcon's defauld config/sync
folder will be untouched.
As core.extension
config is used to track which modules are enabled, we need to make sure we won't conflict Falcon's default core.extension
config.
- Grey-list: choose
core.extension
key under CONDITIONAL SPLIT section and save - This will Splitcore.extension
config and when you enable or disable modules their state will be exported only inconfig/customizations/core.extension.yml
file. - Black-list: after enabling a module go to Customizations config split settings, choose all newly created config keys key under COMPLETE SPLIT section and save.
- Export config using Drush
docker-compose exec {container_name} drush config-export --root=/var/www/html/web
.
This way as those configs that were created by enabling new modules will be moved to config/customizations
directory and won't conflict with Falcon's default config/sync
directory.