Fatal error: Unsupported operand types in /home/thomas/public_html/drupal/includes/common.inc on line 1376
由 New Good Man 在 日, 2009-02-22 09:29 發表
Posted in
有位好朋友,在水隆投上發現了一個錯誤發生:Fatal error: Unsupported operand types in /home/thomas/public_html/drupal/includes/common.inc on line 1376
緊接著趕緊到drupal.org上搜查一下,得知這可能是某個模組在drupal5轉drupal6時傳遞參數給url()時所發生的錯誤。
這裡有篇Troubleshooting FAQ, 說到如何找出產生錯誤的模組。在我們找出錯誤模組後,可以到該模組的Issue中尋找解決之道,如果沒有找到可以發佈一篇bug report請模組維護者協助解決。
這篇文章寫道,需要將原本的common.inc中的程式段進行修改,以便於系統告訴我們那個模組出錯了。
以下的程式段您可以在include/common.inc 中,大約1300行左右可以找到。
<?php
function url($path = NULL, $options = array()) {
// Merge in defaults.
$options += array(
'fragment' => '',
'query' => '',
'absolute' => FALSE,
'alias' => FALSE,
'prefix' => ''
);
?>將他修改為
<?php
function url($path = NULL, $options = array()) {
if (!is_array($options)) {
echo "<pre>";
$backtrace = debug_backtrace();
var_export($backtrace[0]);
die();
}
// Merge in defaults.
$options += array(
'fragment' => '',
'query' => '',
'absolute' => FALSE,
'alias' => FALSE,
'prefix' => ''
);
?>那麼,我們得到的反饋就會如下所示:
array (
'file' => '/www/drupal-6/sites/all/modules/admin_links/admin_links.module',
'line' => 65,
'function' => 'url',
'args' =>
array (
0 => 'node/62/edit',
1 => NULL,
2 => NULL,
3 => true,
),
)這個訊息將會取代原本"Fatal error: Unsupported operand types in /home/thomas/public_html/drupal/includes/common.inc on line 1376" 而新訊息中的file就是發生錯誤的模組,知道後就可以採取行動了。以上供您參考,並且萬分感謝各位好朋友的友情告知,謝謝。
- 瀏覽次數: 903

>w<…水大您好熱心唷!!讚讚讚…
>w<…水大您好熱心唷!!讚讚讚…
我喂人人,人人喂我嘛! 呵呵~~~
我喂人人,人人喂我嘛!
呵呵~~~
發表新回應