【问题标题】:WSOD using Drupal 6 module code in Drupal 7?WSOD 在 Drupal 7 中使用 Drupal 6 模块代码?
【发布时间】:2012-08-22 08:16:04
【问题描述】:

这是我在 Drupal 6 中完美运行的代码,但在 Drupal 7.15 和视图 7.x-3.3 中给了我一个空白的白页 WSOD;

<?php

function ajaxview_menu() {

  $items = array();

  $items['replies'] = array(
    'title' => 'Replies',
    'page callback' => 'ajaxview_replies',
    'description' => 'Replies',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );

  return $items;
}

function ajaxview_replies($nid) {
  $node = node_load($nid);
  $viewName = 'Replies'; 
  $display_id = 'default'; 
  $myArgs = array($nid); 
  print views_embed_view($viewName, $display_id, $myArgs);
 exit();
}

发生了什么变化,我做错了什么?

【问题讨论】:

    标签: php module drupal-7 drupal-views wsod


    【解决方案1】:

    抱歉,这是一个愚蠢的错误。

    $viewName 的机器名称是“replies”而不是“Replies”。

    哇!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多