Install
Works with Drupal: ^10.2 || ^11 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
This release makes the module work again on HTTPS sites, adds Drupal 12 support, and drops Drupal 8 and 9.
Read this before updating
Drupal 8 and 9 are no longer supported. They never actually worked on recent code: Drupal 8 runs on PHP 7.4, where the module's : static return types are parse errors, and on Drupal 9 the module fatals during install because its plugin manager passes an attribute class name that core only accepts from 10.2 onwards. core_version_requirement is now ^10.2 || ^11 || ^12, which is what was verified by building and installing each version.
The graph is now loaded from jsDelivr rather than webgraphviz.com. If your site restricts outbound requests, allow cdn.jsdelivr.net.
Some protected properties and one service were renamed or removed. This only matters if you have subclassed the calculator or controller. See "Changes for developers" below.
Fixed
- The graph never rendered on an HTTPS site.
viz.jswas loaded from the protocol-relative//webgraphviz.com/viz.js, and that host serves a self-signed certificate, so browsers blocked the script and nothing was ever drawn. Both external scripts now come from jsDelivr over explicithttps://. Fixes #3615658. - The user dependencies page showed the wrong entity.
/user/N/entity_dependenciesgraphed node N, because the user was reloaded through the node storage using their user ID. It could also fatal when no node had that ID. - Arrows were labelled with the wrong field. The label was taken from the entity the arrow points at, rather than from the field on the referring entity that creates the reference.
- The ellipsis setting did nothing. Labels were only shortened when the node caption was
name, which is not one of the three options the settings form offers. - A double quote in a title broke the graph. Quotes in labels terminated the quoted string in the generated Graphviz source, so the diagram failed to render.
- Ignored fields configured in the UI never matched. Browsers submit textareas with CRLF line endings, and the value was split on
PHP_EOL, leaving a stray carriage return on every entry. - Log noise. The "entity type is not supported" message printed a broken placeholder and was logged at info level for every unsupported content entity type on every route rebuild. It is now correct, and logged at debug level.
- The zoom controls no longer race the graph: both behaviours previously ran on document ready, and the zoom behaviour could look for an SVG the graph behaviour had not inserted yet.
Added
- Drupal 12 support, verified against 12.0-dev alongside 10.6 and 11.4.
- Pluggable dependency calculators. The reference walking is now a plugin. The built-in Native calculator needs nothing extra; an optional
entity_dependency_visualizer_depcalcsubmodule delegates to Dependency Calculation instead. The submodule is experimental — see "Known issues". - A test suite, from none to 20 tests across unit, kernel and functional, with a regression test behind every bug fixed above.
- A README, covering permissions, configuration, supported entity types and troubleshooting.
- Continuous integration that actually reports. The pipeline now runs PHPUnit and PHPStan against Drupal 10, 11 and 12 rather than leaving those jobs sitting unrun, and phpcs, PHPStan, ESLint, Stylelint and CSpell all block and are all clean.
Changes for developers
- Protected properties were renamed to Drupal's lowerCamel convention:
$dependency_stackto$dependencyStack,$supported_entity_typesto$supportedEntityTypes,$supported_entity_reference_typesto$supportedEntityReferenceTypes, and in the Graphviz controller$graph_obj,$node_formatting,$max_depthand$max_node_label_sizeto their camelCase equivalents. - The
entity_dependency_visualizer.graphvizservice was removed. It could never be built: the class requires a constructor argument the definition never supplied. DependencyCalculatorServiceProviderwas removed. It referenced a service and a class that do not exist, and was never loaded, because its class name does not match Drupal's service provider naming convention.- The calculator plugins now use the
#[DependenciesCalculator]PHP attribute instead of the annotation, which is deprecated for removal in Drupal 13. RouteSubscriber,ConfigFormand the depcalc submodule use injected services instead of\Drupal::calls.- The native calculator now records, per edge, which field on the parent produced each child, as
child_fields[<child uuid>]. Custom calculators that populate it get correct arrow labels for free.
Known issues
- The
entity_dependency_visualizer_depcalcsubmodule is experimental. Its arrow labels show@todoplaceholders and it drops some references from the graph. See #3619050. - That submodule declares
^10.2 || ^11rather than following the main module to Drupal 12, becausedrupal/depcalchas no Drupal 12 release yet.