歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 18, 2024, 04:51:18 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  測試  |  LifeType 1.0 測試  |  編輯文章預覽時,錯誤訊息解決辦法!! « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 編輯文章預覽時,錯誤訊息解決辦法!!  (閱讀 9091 次)
cody
新手見習
*
文章: 39


檢視個人資料
« 於: 三月 14, 2005, 02:40:57 下午 »

一般純文字不會有問題,加入語法就會有問題
因為 session 前不能有輸出的動作
到 ==>  class/view/view.class.php  尋找下面語法
                function sendContentType()
                {
                        // build up the header and send it
                        $header = "Content-Type: ".$this->_contentType.";charset
=".$this->_charset;
                        //header( $header );   // 這裡把他註解起來就 OK 了

                        return true;
                }


另外一個 Invalid argument supplied for foreach()  錯誤解決辦法如下:
到 ===> class/action/admin/adminpreviewpostaction.class.php
尋找下面語法
        function _loadArticleCategories( $categoryIds )
        {
                $articleCategories = new ArticleCategories();
                $categories = Array();
                //foreach( $categoryIds on $categoryId ) // 這邊把他斷行下去  
                // 這裏不需要  foreach 處理 , 所以  註解起來
                {
                        $category = $articleCategories->getCategory( $categoryIds, $this->_blogInfo->getId());  
//   $categoryIds  原本是 $categoryId  要加 "s"  喔
                        if( $category )
                                array_push( $categories, $category );
                }
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 三月 14, 2005, 05:53:25 下午 »

引用自: cody
一般純文字不會有問題,加入語法就會有問題
因為 session 前不能有輸出的動作
到 ==>  class/view/view.class.php  尋找下面語法
                function sendContentType()
                {
                        // build up the header and send it
                        $header = "Content-Type: ".$this->_contentType.";charset
=".$this->_charset;
                        //header( $header );   // 這裡把他註解起來就 OK 了

                        return true;
                }


基本上這個 Bug 沒辦法這樣修。並非是有文字輸出。而是  目前 previewpost  是採用 get method 得方式在傳送內容。而 URL 因為過長被截斷。所以才導致這個 Bug 出現。你可以到  adminpreviewpostaction.class.php 中把 //print_r($_REQUEST) uncomment 掉。就可以看到我所說得情況。

另外 view 中的 header 輸出是我們刻意加上的,因為我們希望能讓 pLog 來 control content-type 的變數,而非讓 <meta.... charset=utf-8"> 或是文字輸出來決定。所以那一行沒辦法拿掉。

引用自: cody

另外一個 Invalid argument supplied for foreach()  錯誤解決辦法如下:
到 ===> class/action/admin/adminpreviewpostaction.class.php
尋找下面語法
        function _loadArticleCategories( $categoryIds )
        {
                $articleCategories = new ArticleCategories();
                $categories = Array();
                //foreach( $categoryIds on $categoryId ) // 這邊把他斷行下去  
                // 這裏不需要  foreach 處理 , 所以  註解起來
                {
                        $category = $articleCategories->getCategory( $categoryIds, $this->_blogInfo->getId());  
//   $categoryIds  原本是 $categoryId  要加 "s"  喔
                        if( $category )
                                array_push( $categories, $category );
                }


這個因為 url length 的 bug,不僅會讓 preview 錯誤,連 savedraft 都會錯誤。請參考 http://bugs.lifetype.net/view.php?id=339&nbn=9#bugnotes 。我已經修復了 savedraft 的問題,但是 previewpost 還沒。

另外。category 沒辦法這樣改,因為目前pLog category 為多選,你這樣當 $categoryIds 只有一個值的時候 okay,但是多個值的時候會出錯。

但這是很好的嘗試。加油。

Mark
已記錄

頁: [1]
LifeType 中文開發論壇  |  測試  |  LifeType 1.0 測試  |  編輯文章預覽時,錯誤訊息解決辦法!! « 上篇主題 下篇主題 »
    前往: