Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Drupal 中,我想设置一个仅在工作流状态更改为特定状态时运行的规则。例如,如果一个应用程序被标记为“已提交”并且之前被标记为“草稿”,我想执行一个特定的 PHP 块。
这可能吗?
是的,使用规则模块非常简单。规则模块允许您测试特定字段的更改并测试其值,然后运行一些操作。您需要在模块代码中创建自己的操作并使其可用于规则,以便您可以执行自己的 php 代码,有一些很好的示例,drupal.org/project/rules。
您应该能够在不编写自己的集成代码的情况下使用规则,因为与 Workflow捆绑在一起的 Workflow Rules 模块会执行此操作。