OSDN Git Service

<%itemtime%>タグをパースする度にイベント「PreAddItemForm」が発生するバグの修正
authorsakamocchi <o-takashi@sakamocchi.jp>
Sat, 2 Jun 2012 09:05:27 +0000 (18:05 +0900)
committersakamocchi <o-takashi@sakamocchi.jp>
Sat, 2 Jun 2012 09:05:27 +0000 (18:05 +0900)
イベント「PreAddItemForm」はAdmin::action_createitem()ですでに発生しているため、AdminActions::parse_itemtime()で発生する必要がない。

以下で報告されたバグの修正も含む
http://sourceforge.jp/projects/nucleus-jp/lists/archive/developers/2012-June/001059.html

nucleus/libs/AdminActions.php

index 630bcb2..f09c6c6 100644 (file)
@@ -3352,34 +3352,7 @@ class AdminActions extends BaseActions
        {
                global $manager;
                
-               $item = false;
-               $itemid = intRequestVar('itemid');
-               $item =& $manager->getItem($itemid, 1, 1);
-               
-               if ( $item )
-               {
-                       $blog =& $manager->getBlog($item['blogid']);
-                       
-                       if ( $blog->convertBreaks() && requestVar('action') == 'itemedit' )
-                       {
-                               $item['body'] = removeBreaks($item['body']);
-                               $item['more'] = removeBreaks($item['more']);
-                       }
-               }
-               
-               $contents = array();
-               if ( requestVar('action') == 'itemedit' )
-               {
-                       $contents = $item;
-               }
-               elseif ( requestVar('action') == 'createitem' )
-               {
-                       $data = array(
-                               'contents'      => &$contents,
-                               'blog'          => &$this->blog
-                       );
-                       $manager->notify('PreAddItemForm', $data);
-               }
+               $contents = Admin::$contents;
                $itemtime = getdate($contents['timestamp']);
                echo $itemtime[$key];
                return;