opCommunityTopicPlugin1.1.0コメント出来ないエラー
- このフォーラムに新規トピックを投稿できます
- このフォーラムではゲスト投稿が許可されています
投稿ツリー
- opCommunityTopicPlugin1.1.0コメント出来ないエラー (serizawa, 2013/3/19 22:29)
- Re: opCommunityTopicPlugin1.1.0 (serizawa, 2013/3/20 11:36)
- Re: Re: opCommunityTopicPlugin1.1.0 (serizawa, 2013/3/20 18:56)
- opDiaryPlugin1.5.0コメント出来ないエラー (kondo, 2013/10/24 11:00)
- Re: opCommunityTopicPlugin1.1.0コメント出来ないエラー (kondo, 2014/11/19 16:15)
- Re: opDiaryPlugin1.5.0コメント出来ないエラー (kondo, 2014/12/16 22:43)
コミュニティのトピックで、退会したmember(ゲスト)の投稿が存在する場合、コメントを送信するとエラーが表示されコメントを投稿することができません。
opCommunityTopicPlugin -r 1.1.0
500 | Internal Server Error | Doctrine_Table_Exception You must specify the value to findOneBy stack trace 1.at ()
in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/ lib/vendor/doctrine/Doctrine/Table.php line 2824 ... 2821. 2822. if (isset($by)) { 2823. if ( ! isset($arguments[0])) { 2824. throw new Doctrine_Table_Exception('You must specify the value to ' . $method); 2825. } 2826. 2827. $fieldName = $this->_resolveFindByFieldName($by);
2.at Doctrine_Table->__call('findOneByMemberIdAndName', array(null, 'notification_center')) in SF_ROOT_DIR/lib/util/opNotificationCenter.class.php line 35 ... 3.at MemberConfigTable->findOneByMemberIdAndName(null, 'notification_center') in SF_ROOT_DIR/lib/util/opNotificationCenter.class.php line 35 ... 4.at opNotificationCenter::notify(object('Member'), object('Member'), '1 件のトピックに新着コメントがあります', array('category' => 'other', 'url' => '/iness/communityTopic/23', 'icon_url' => null)) in SF_ROOT_DIR/plugins/opCommunityTopicPlugin/lib/util/opCommunityTopicPluginUtil.class.php line 12 ...
5.at opCommunityTopicPluginUtil::sendNewCommentNotification(object('Member'), object('Member'), '23') in SF_ROOT_DIR/plugins/opCommunityTopicPlugin/lib/model/doctrine/PluginCommunityTopicComment.class.php line 66 ... 6.at PluginCommunityTopicComment->postSave(object('Doctrine_Event')) in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php line 354 ... 7.at Doctrine_Record->invokeSaveHooks('post', 'save', object('Doctrine_Event')) in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php line 116 ... 8.at Doctrine_Connection_UnitOfWork->saveGraph(object('CommunityTopicComment')) in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php line 1718 ... 9.at Doctrine_Record->save(object('opDoctrineConnectionMysql')) in SF_ROOT_DIR/lib/util/opDoctrineRecord.class.php line 66 ... 10.at opDoctrineRecord->save(object('opDoctrineConnectionMysql'))i
in SF_ROOT_DIR/lib/vendor/symfony/lib/form/addon/sfFormObject.class.php line 161 ... 11.at sfFormObject->doSave(object('opDoctrineConnectionMysql')) in SF_ROOT_DIR/lib/vendor/symfony/lib/form/addon/sfFormObject.class.php line 130 ... 12.at sfFormObject->save(null) in SF_ROOT_DIR/plugins/opCommunityTopicPlugin/lib/form/doctrine/PluginCommunityTopicCommentForm.class.php line 91 ... 13.at PluginCommunityTopicCommentForm->save() in SF_ROOT_DIR/plugins/opCommunityTopicPlugin/lib/action/opCommunityTopicPluginTopicCommentActions.class.php line 59 ... 14.at opCommunityTopicPluginTopicCommentActions->executeCreate(object('opWebRequest')) in SF_ROOT_DIR/lib/vendor/symfony/lib/action/sfActions.class.php line 60 ... 15.at sfActions->execute(object('opWebRequest')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php line 92 ... 16.at sfExecutionFilter->executeAction(object('communityTopicCommentActions')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php line 78 ... 17.at sfExecutionFilter->handleAction(object('sfFilterChain'), object('communityTopicCommentActions')) in SF_ROOT_DIR/lib/filter/opExecutionFilter.class.php line 162 ... 18.at opExecutionFilter->handleAction(object('sfFilterChain'), object('communityTopicCommentActions')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php line 42 ... 19.at sfExecutionFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... 20.at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opEmojiFilter.class.php line 29 ... 21.at opEmojiFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... 22.at sfFilterChain->execute() in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfBasicSecurityFilter.class.php line 72 ... 23.at sfBasicSecurityFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... 24.at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opAppendXRDSHeaderFilter.class.php line 26 ... 25.at opAppendXRDSHeaderFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... 26.at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opCheckEnabledApplicationFilter.class.php line 39 ... 27.at opCheckEnabledApplicationFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... 28.at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opCacheControlFilter.class.php line 27 ... 29.at opCacheControlFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... 30.at sfFilterChain->execute() in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfRenderingFilter.class.php line 33 ... 31.at sfRenderingFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... 32.at sfFilterChain->execute() in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfController.class.php line 238 ... 33.at sfController->forward('communityTopicComment', 'create') in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfFrontWebController.class.php line 48 ... 34.at sfFrontWebController->dispatch() in SF_ROOT_DIR/lib/vendor/symfony/lib/util/sfContext.class.php line 170 ... 35.at sfContext->dispatch() in SF_ROOT_DIR/web/pc_frontend_dev.php line 14 ... symfony settings ... request ... response ... user ... global vars ... symfony v.1.4.13 - php 5.3.19 for help resolving this issue, please visit http://www.symfony-project.org/.
環境
CentOS6.3
php5.3.19
MySQL5.5.28
opCommunityTopicPlugin1.0.4になく、通知センターに関係する新しファイル
./plugins/opCommunityTopicPlugin/lib/util/opCommunityTopicPluginUtil.class.php
1 <?php 2 3 class opCommunityTopicPluginUtil 4 { 5 public static function sendNewCommentNotification ($fromMember, $toMember, $topicId){ 6 $rootPath = sfContext::getInstance()->getRequest()->getRelativeUrlRoot(); 7 $url = $rootPath.'/communityTopic/'.$topicId; 8 9 sfApplicationConfiguration::getActive()->loadHelpers(array('I18N')); 10 $message = format_number_choice('[1]1 topic has new comments|(1,Inf]%1% topics hav e new comments', array('%1%'=>'1'), 1); 11 12 opNotificationCenter::notify($fromMember, $toMember, $message, array('category'=>' other', 'url'=>$url, 'icon_url'=>null)); 13 } 14 }
12行目をコメントアウトするとエラーが起きなくなるのでここを調べてみる
./plugins/opCommunityTopicPlugin/lib/util/opCommunityTopicPluginUtil.class.php
修正案1
1 <?php 2 3 class opCommunityTopicPluginUtil 4 { 5 public static function sendNewCommentNotification ($fromMember, $toMember, $topicId){ 6 $rootPath = sfContext::getInstance()->getRequest()->getRelativeUrlRoot(); 7 $url = $rootPath.'/communityTopic/'.$topicId; 8 9 sfApplicationConfiguration::getActive()->loadHelpers(array('I18N')); 10 $message = format_number_choice('[1]1 topic has new comments|(1,Inf]%1% topics hav e new comments', array('%1%'=>'1'), 1); 11 12 if($Member->member_id != NULL){ opNotificationCenter::notify($fromMember, $toMember, $message, array('category'=>' other', 'url'=>$url, 'icon_url'=>null)); } 13 } 14 }
日記の場合、退会者のコメントを残す設定をDB外部キー制約(ForeignKey)でしている場合は、同じく下記のように修正します。
./plugins/opDiaryPlugin/lib/util/opDiaryPluginUtil.class.php
if($Member->member_id != null){ opNotificationCenter::notify($fromMember, $toMember, $message, array('category'=>'other', 'url'=>$url, 'icon_url'=>null)); }
公式で修正されました。
https://github.com/amashigeseiji/opCommunityTopicPlugin/commit/c1356639aa76bdca7f05b74b5a2417a6944fd803
./plugins/opCommunityTopicPlugin/lib/model/doctrine/PluginCommunityTopicComment.class.php
49行目追記 ->andWhere('member_id IS NOT NULL')
$comments = Doctrine::getTable('CommunityTopicComment') ->createQuery('q') ->where('community_topic_id = ?', $this->getCommunityTopic()->getId()) ->andWhere('member_id IS NOT NULL') ->execute(); $toMembers = array(); foreach($comments as $comment)
下記により修正出来ました。
https://github.com/isaosano/opDiaryPlugin/commit/9f9927ac226090314e2467006cd5a36c333e6db0
/plugins/opDiaryPlugin/lib/model/doctrine/PluginDiaryComment.class.php
&& !is_null($comment->getMemberId())
47行目に追記します。
if(false == array_key_exists($comment->getMemberId(), $toMembers) && $comment->getMemberId() !== $this->Diary->member_id && $comment->getMemberId() !== $this->member_id && !is_null($comment->getMemberId())