Project

General

Profile

Bug(バグ) #4431

pc_backend.php/member/invite にてサーバエラーが発生する

Added by kaoru n 7 months ago. Updated 4 months ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Assignee:
Target version:
Start date:
2020-04-02
Due date:
% Done:

100%

3.6 で発生するか:
Unknown (未調査)
3.8 で発生するか:
No (いいえ)

Description

Overview (現象)

pc_backend.php/member/invite にアクセスすると以下のエラーが発生する。

Fatal error: Uncaught Error: Call to a member function pluralize() on null in (snip)/lib/form/doctrine/MemberConfigForm.class.php:106 Stack trace: #0 (snip)/lib/form/doctrine/MemberConfigForm.class.php(28): MemberConfigForm->setMemberConfigSettings() #1 (snip)/lib/form/MemberConfigForm/MemberConfigPcAddressForm.class.php(24): MemberConfigForm->__construct(NULL, Array, NULL) #2 (snip)/apps/pc_backend/modules/member/actions/actions.class.php(101): MemberConfigPcAddressForm->__construct(NULL, Array) #3 (snip)/lib/vendor/symfony/lib/action/sfActions.class.php(60): memberActions->executeInvite(Object(opWebRequest)) #4 (snip)/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php(92): sfActions->execute(Object(opWebRequest)) #5 (snip)/l in (snip)/lib/form/doctrine/MemberConfigForm.class.php on line 106

Causes (原因)

https://github.com/openpne/OpenPNE3/blob/OpenPNE-3.10.0/lib/form/doctrine/MemberConfigForm.class.php#L105

    $termMyFriend = Doctrine::getTable('SnsTerm')->get('my_friend');
にて、sns_term.application = 'pc_backend' & sns_term.name = 'my_friend' のレコードが存在しないため。

Way to fix (修正内容)

https://github.com/nishizoe/OpenPNE3/blob/OpenPNE-3.8.10/lib/i18n/opI18N.class.php#L23-L30

    $this->terms = Doctrine::getTable('SnsTerm');
    $application = sfConfig::get('sf_app');
    if ('pc_backend' == $application)
    {
        $application = 'pc_frontend';
    }
    $this->terms = Doctrine::getTable('SnsTerm');
    $this->terms->configure($this->culture, $application);
と同様に、configure を行う


Subtasks

Backport(バックポート) #4432: pc_backend.php/member/invite にてサーバエラーが発生するFixed(完了)kaoru n

History

#1 Updated by kaoru n 7 months ago

  • Status changed from New(新規) to Pending Review(レビュー待ち)
  • % Done changed from 0 to 50

https://github.com/openpne/OpenPNE3/pull/601
にてプルリクエストしました

#2 Updated by kaoru n 7 months ago

  • Target version changed from OpenPNE 3.10.x to OpenPNE 3.11.x

#3 Updated by Rimpei Ogawa 5 months ago

  • Status changed from Pending Review(レビュー待ち) to Rejected(差し戻し)

$i18n は opI18N のインスタンスだと思いますので、$terms を作成する処理自体が不要ではないかと思いました。

--- a/lib/form/doctrine/MemberConfigForm.class.php
+++ b/lib/form/doctrine/MemberConfigForm.class.php
@@ -102,14 +102,12 @@ class MemberConfigForm extends BaseForm
     }

     $i18n = sfContext::getInstance()->getI18N();
-    $termMyFriend = Doctrine::getTable('SnsTerm')->get('my_friend');
-    $terms = array('%my_friend%' => $termMyFriend->pluralize()->titleize());
     $publicFlagChoiceNames = ['age_public_flag', 'profile_page_public_flag'];
     foreach ($publicFlagChoiceNames as $name)
     {
       foreach ($configs[$name]['Choices'] as $key => $publicFlag)
       {
-        $configs[$name]['Choices'][$key] = $i18n->__($publicFlag, $terms, 'publicFlags');
+        $configs[$name]['Choices'][$key] = $i18n->__($publicFlag, array(), 'publicFlags');
       }
     }

#4 Updated by kaoru n 5 months ago

  • Status changed from Rejected(差し戻し) to Pending Review(レビュー待ち)

#5 Updated by Rimpei Ogawa 5 months ago

  • Status changed from Pending Review(レビュー待ち) to Pending Testing(テスト待ち)
  • % Done changed from 50 to 70

#6 Updated by isao sano 5 months ago

  • Status changed from Pending Testing(テスト待ち) to Pending Merge(マージ待ち)
  • % Done changed from 70 to 80

試験完了しました。
問題ありません。

#7 Updated by kaoru n 4 months ago

  • Status changed from Pending Merge(マージ待ち) to Fixed(完了)
  • % Done changed from 80 to 100

マージしました

Also available in: Atom PDF