drupal模块路径和视图路径冲突

时间:2015-08-27 15:34:30

标签: drupal drupal-7 drupal-modules drupal-views

在Drupal 7中,我创建了一个自定义模块。使用菜单钩子我定义了以下路径:

  $items['reports/%'] = [
    'page callback' => 'report_area_page_ajax',
    'page arguments' => [1],
    'access callback' => true, // todo: set this
    'type' => MENU_CALLBACK,
    'depathlivery callback' => 'report_ajax_get_ajax'
  ];

接下来,我在Views(最新版本7.x-3.11)中创建了一个页面,其路径为'reports /%/ archive'。

当请求'reports /%/ archive'时,我遇到这些错误似乎有某种冲突:

Warning: Invalid argument supplied for foreach() in element_children() (line 6525 of /home/user/domains/domain/public_html/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5982 of /home/user/domains/domain/public_html/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5992 of /home/user/domains/domain/public_html/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 6030 of /home/user/domains/domain/public_html/includes/common.inc).
Warning: Illegal string offset '#printed' in drupal_render() (line 6037 of /home/user/domains/domain/public_html/includes/common.inc).

当我使用其他路径(例如bla /%)配置视图时,可以请求视图页面而不会出现任何错误。

导致这种情况的原因是什么?

0 个答案:

没有答案