■ユーザーズフォーラム リニューアルのお知らせ
新規投稿は新ユーザーズフォーラムにお願いします。

Re: 記事・ページの複製時にエラーが出る

kiwanami > Re: 記事・ページの複製時にエラーが出る @ 2012/6/28 1:45
先ほどの続きです。
Blogプラグインにて、「サイト内検索の検索結果より除外する」にチェックが入っている記事を複製すると、以下のようなエラーの表示が出てきました。


Notice (8): Undefined index: id [CORE/baser/plugins/blog/models/blog_post.php, line 491]


以下の修正を行うとエラーが出なくなりました。

修正箇所 : /baser/plugins/blog/models/blog_post.php


diff -wc blog_post.php.org blog_post.php

*** blog_post.php.org   Wed Jun 27 23:31:58 2012
--- blog_post.php       Wed Jun 27 23:34:44 2012
***************
*** 488,494 ****
--- 488,502 ----
                if(!$this->data['BlogPost']['exclude_search']) {
                        $this->saveContent($this->createContent($this->data));
                } else {
+                     if (!empty($this->data['BlogPost']['id'])) {
+                         //$this->log("UPDATE: PK=" . $this->data['BlogPost']['id'],LOG_DEBUG);
                          $this->deleteContent($this->data['BlogPost']['id']);
+                     } else if (!empty($this->id)) {
+                         //$this->log("INSERT: PK=" . $this->id,LOG_DEBUG);
+                         $this->deleteContent($this->id);
+                     } else {
+                         $this->cakeError('Not found pk-value in BlogPost.');
+                   }
                }
  
        }


多分この修正で合ってると思うのですが、もし間違っていたら教えてください。

よろしくおねがいします。
ログイン
ユーザー名:
パスワード:


  新規登録 / パスワード紛失

検索

facebook
フォーラムで悩みが解決した場合など、よかったら「いいね!」をポチっとクリックしてください!質問の回答者や開発者の励みになります

フォーラムガイド


関連リンク

オンライン状況
19 人のユーザが現在オンラインです。 (16 人のユーザが フォーラム を参照しています。)

登録ユーザ: 0
ゲスト: 19