dmwg / wisski_entity_reference_tree

WissKI 的实体引用树构建器。

安装: 98

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 7

类型:drupal-module

0.1.0 2024-05-14 06:44 UTC

README

CI workflow Packagist Version Packagist Downloads GitHub License Packagist Dependency Version

一个扩展 drupal/entity_reference_tree 的 Drupal 模块,通过路径构建器中的消歧点配置实体层次结构,例如标签或其他分类法形式。此模块依赖于 drupal/entity_reference_tree 并在 2.1.0 版本上成功测试。

注意: 此模块依赖于在 src/web/modules/contrib/entity_reference_tree/src/Controller/EntityReferenceTreeController.php:104 中定义的其他树构建器的动态分派。如果此分派消失,此模块将 损坏(或者至少停止工作,这与损坏相同)。

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');
}

要求

  • PHP ^8.2
  • drupal/wisski(在 3.15 上测试)1
  • drupal/entity_reference_tree(在 2.3.2 上测试)1

安装

$ composer require dmwg/wisski_entity_reference_tree

用法

  1. 通过 /admin/modules 启用此模块以及 drupal/entity_reference_tree
  2. /admin/structure/ 下,配置所需的包
    1. 转到 管理表单显示
    2. 对于所需字段,将类型设置为 "实体引用树"
    3. (可选)配置小部件的主题和其他布局属性

贡献

我们欢迎通过此存储库的拉取请求提交所有和任何贡献!

本地开发环境

对于本地开发,强烈建议将此模块安装到现有的 Drupal 代码库中,例如在 web/modules/custom 下。此外,我们建议至少安装一个基本的 WissKI(例如,请参阅 drupal/wisski)。这将提供更丰富的基于 Drupal 的代码完成,以及 WissKI 特定的代码。

重要: 没有本地 Drupal 安装,通过 phpstan 进行的静态分析将失败,因为它依赖于 Drupal 自动加载器。

以下示例假定已安装,并克隆到 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

代码检查与静态分析

请运行 vendor/bin/phpcs --standard=Drupal 并修复任何标记的错误;vendor/bin/phpcbf --standard=Drupal src 可帮助修复。

请运行 vendor/bin/phpstan 并修复任何错误;不要让构建失败阻止你,我们将在 PR 中尽力解决。

作者与致谢

  • Oliver Baumann <oliver.baumann@uni-bayreuth.de>
    • 重构与维护
  • Myriel Fichtner
    • 概念与原始版本
  • Philipp Eisenhuth
    • 概念与原始版本

项目状态

活跃,但休眠。