Actions
Bug(バグ) #4431
closedpc_backend.php/member/invite にてサーバエラーが発生する
Start date:
2020-04-02
Due date:
% Done:
100%
Estimated time:
(Total: 0:00 h)
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 (原因)¶
$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 を行う
Updated by kaoru n over 4 years ago
- Status changed from New(新規) to Pending Review(レビュー待ち)
- % Done changed from 0 to 50
https://github.com/openpne/OpenPNE3/pull/601
にてプルリクエストしました
Updated by kaoru n over 4 years ago
- Target version changed from OpenPNE 3.10.x to OpenPNE 3.11.x
Updated by Rimpei Ogawa over 4 years 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'); } }
Updated by kaoru n over 4 years ago
- Status changed from Rejected(差し戻し) to Pending Review(レビュー待ち)
Updated by Rimpei Ogawa over 4 years ago
- Status changed from Pending Review(レビュー待ち) to Pending Testing(テスト待ち)
- % Done changed from 50 to 70
Updated by isao sano over 4 years ago
- Status changed from Pending Testing(テスト待ち) to Pending Merge(マージ待ち)
- % Done changed from 70 to 80
試験完了しました。
問題ありません。
Updated by kaoru n over 4 years ago
- Status changed from Pending Merge(マージ待ち) to Fixed(完了)
- % Done changed from 80 to 100
マージしました
Actions