Add #module_name, so it's easier to extract dependencies of actions and conditions.

CommentFileSizeAuthor
rules_module_in_item-1.patch2.18 KBamitaibu

Comments

fago’s picture

Component: Rules Core » Rules Engine
Status: Needs review » Closed (won't fix)

Your patch adds #module_name only for the first item, I think?

Nevertheless I think it's better to that in a separate function. The API/module won't make use of #module_name and we have already #module, thus this becomes confusing. So best don't change that for rules 1.x, but do it for rules 2.x I think we should rename the current #module to #group and introduce proper dependency / requirement maintenance for the whole API. For rules 1.x we can do it like features does it for views:


function views_handler_dependencies() {
  views_include_handlers();

  static $map;
  if (!isset($map)) {
    $map = array();
    foreach (module_implements('views_data') as $module) {
      $tables = array_keys(module_invoke($module, 'views_data'));
      foreach ($tables as $table) {
        $map[$table] = $module;
      }
    }
  }
  return $map;
}

-> Thus we could do something like that, that also works for all hook types like rules_gather_data() but keeping it separated.