dmwg / wisski_entity_reference_tree
An entity reference tree builder for WissKI.
Installs: 154
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 4
Type:drupal-module
Requires
- php: >=8.2
- drupal/entity_reference_tree: ^2.4
- drupal/wisski: ^3.16
Requires (Dev)
- drupal/coder: ^8.3
- ergebnis/composer-normalize: ^2.44
- mglaman/phpstan-drupal: ^1.3
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^1.12
- phpstan/phpstan-deprecation-rules: ^1.2
- thecodingmachine/phpstan-strict-rules: ^1.0
This package is auto-updated.
Last update: 2025-03-01 00:41:53 UTC
README
A Drupal module extending drupal/entity_reference_tree to provide a hierarchy of entities configured through disambiguation points in the pathbuilder, e.g., tags or other forms of taxonomy.
This module depends on drupal/entity_reference_tree
and was tested successfully with 2.1.0
.
Note: This module depends on the dynamic dispatch to other tree-builders defined in src/web/modules/contrib/entity_reference_tree/src/Controller/EntityReferenceTreeController.php:104
.
Should this dispatch ever go away, this module will break (or at least cease to function, which is the same).
Required dynamic dispatch in drupal/entity_reference_tree
:
// Instance a entity tree builder for this entity type if it exists. if (\Drupal::hasService('entity_reference_' . $entity_type . '_tree_builder')) { $treeBuilder = \Drupal::service('entity_reference_' . $entity_type . '_tree_builder'); }
Requirements
Installation
$ composer require dmwg/wisski_entity_reference_tree
Usage
- Enable this module, along with
drupal/entity_reference_tree
via/admin/modules
- Under
/admin/structure/
, configure the required bundle:- Go to
Manage form display
- For the required field, set the type to "Entity reference tree"
- (optional) Configure the theme of the widget and other layout properties
- Go to
Contributing
We welcome all and any contributions via Pull Requests to this repository!
Local development environment
For local development, it is highly recommended to install this module into an existing Drupal codebase, e.g., under web/modules/custom
.
Furthermore, we recommend at least a basic WissKI installation (c.f. drupal/wisski
).
This will provide a richer code-completion for base-Drupal, as well as WissKI-specific code.
Important: without a local Drupal installation, static analysis via phpstan
will fail miserably, as it relies on a Drupal autoloader.
The following example assumes an installation, and clones into web/modules/custom
:
$ cd <DRUPAL_ROOT>/web/modules/custom $ git clone https://github.com/dmwg/wisski_entity_reference_tree $ cd wisski_entity_reference $ composer install
Linting & Static analysis
Please run vendor/bin/phpcs --standard=Drupal
and fix any flagged errors; vendor/bin/phpcbf --standard=Drupal src
can assist.
Please run vendor/bin/phpstan
and fix any errors; don't let a failing build discourage you, we'll try and figure it out in the PR.
Authors and acknowledgment
Oliver Baumann <oliver.baumann@uni-bayreuth.de>
- Refactoring & Maintenance
Myriel Fichtner
- Concept & original version
Philipp Eisenhuth
- Concept & original version
Project status
Alive, but dormant.