Project

General

Profile

Backport(バックポート) #3216

管理画面「Web 全体への年齢公開許可設定」および「メンバーのプロフィールページ公開範囲設定」のデフォルト値を変更しても設定に反映されない

Added by Yuya Watanabe about 11 years ago. Updated over 10 years ago.

Status:
Fixed(完了)
Priority:
Low(低め)
Assignee:
Target version:
Start date:
2012-07-24
Due date:
% Done:

100%


Description

概要

管理画面「Web 全体への年齢公開許可設定」および「メンバーのプロフィールページ公開範囲設定」のデフォルト値を変更しても設定に反映されない.

具体的には下記ファイルの 173 行目および 160 行目 を変更しても pc_frontend 側で設定が反映されていない.

lib/config/config/sns_config.yml
166   is_allow_web_public_flag_age:
167     Name:       "is_allow_web_public_flag_age" 
168     Caption:    "Web 全体への年齢公開許可設定" 
169     Help:       "メンバーが年齢を Web 全体に公開できるようにするかどうかを設定します" 
170     FormType:   "radio" 
171     ValueType:  "text" 
172     IsRequired: true
173     Default:    0
174     Choices:
175       0: "メンバーの設定を許可しない" 
176       1: "メンバーの設定を許可する" 
lib/config/config/sns_config.yml
153   is_allow_config_public_flag_profile_page:
154     Name:       "is_allow_config_public_flag_profile_page" 
155     Caption:    "メンバーのプロフィールページ公開範囲設定" 
156     Help:       "メンバーがプロフィールページの公開範囲を変更できるようにするどうかを設定します" 
157     FormType:   "radio" 
158     ValueType:  "text" 
159     IsRequired: true
160     Default:    1
161     Choices:
162       0: "メンバーの設定を許可する" 
163       1: "メンバーの設定を許可しない(全員に公開)" 
164       4: "メンバーの設定を許可しない(Web全体に公開)" 

確認バージョン

OpenPNE 3.8.0
OpenPNE 3.6.4

原因

年齢を得るメソッドで設定ファイルが考慮されていない.

lib/model/doctrine/Member.class.php

 56   public function getAge($viewableCheck = false, $myMemberId = null)
 57   {
...
 82     if (ProfileTable::PUBLIC_FLAG_WEB == $publicFlag && Doctrine::getTable('SnsConfig')->get('is_allow_web_public_flag_age'))
 83     {
 84       return $age;
 85     }

修正案

デフォルト値を考慮した実装に変更する.

diff --git a/lib/model/doctrine/Member.class.php b/lib/model/doctrine/Member.class.php
index 5dd0d1a..b1a7d5f 100644
--- a/lib/model/doctrine/Member.class.php
+++ b/lib/model/doctrine/Member.class.php
@@ -79,7 +79,7 @@ class Member extends BaseMember implements opAccessControlRecordInterface
       return $age;
     }

-    if (ProfileTable::PUBLIC_FLAG_WEB == $publicFlag && Doctrine::getTable('SnsConfig')->get('is_allow_web_public_flag_age'))
+    if (ProfileTable::PUBLIC_FLAG_WEB == $publicFlag && opConfig::get('is_allow_web_public_flag_age'))
     {
       return $age;
     }
diff --git a/lib/form/MemberConfigForm/MemberConfigPublicFlagForm.class.php b/lib/form/MemberConfigForm/MemberConfigPublicFlagForm.class.php
index 69fd9d9..9047bae 100644
--- a/lib/form/MemberConfigForm/MemberConfigPublicFlagForm.class.php
+++ b/lib/form/MemberConfigForm/MemberConfigPublicFlagForm.class.php
@@ -23,12 +23,12 @@ class MemberConfigPublicFlagForm extends MemberConfigForm
   {
     parent::__construct($member, $options, $CSRFSecret);

-    if (Doctrine::getTable('SnsConfig')->get('is_allow_config_public_flag_profile_page'))
+    if (opConfig::get('is_allow_config_public_flag_profile_page'))
     {
       unset($this['profile_page_public_flag']);
     }

-    if (!Doctrine::getTable('SnsConfig')->get('is_allow_web_public_flag_age'))
+    if (!opConfig::get('is_allow_web_public_flag_age'))
     {
       $widget = $this->widgetSchema['age_public_flag'];

diff --git a/lib/model/doctrine/MemberTable.class.php b/lib/model/doctrine/MemberTable.class.php
index 8ad8a28..0c995a9 100644
--- a/lib/model/doctrine/MemberTable.class.php
+++ b/lib/model/doctrine/MemberTable.class.php
@@ -116,9 +116,9 @@ class MemberTable extends opAccessControlDoctrineTable
       ->allow('self', $resource, 'edit')
       ->deny('blocked');

-    if (Doctrine::getTable('SnsConfig')->get('is_allow_config_public_flag_profile_page'))
+    if (opConfig::get('is_allow_config_public_flag_profile_page'))
     {
-      $config = Doctrine::getTable('SnsConfig')->get('is_allow_config_public_flag_profile_page');
+      $config = opConfig::get('is_allow_config_public_flag_profile_page');
     }
     elseif ($resource)
     {


Related issues

Related to OpenPNE 3 - Bug(バグ) #3130: 管理画面「Web 全体への年齢公開許可設定」および「メンバーのプロフィールページ公開範囲設定」のデフォルト値を変更しても設定に反映されない Won't fix(対応せず) 2012-07-24

Associated revisions

Revision 3c856d10 (diff)
Added by Yuya Watanabe over 10 years ago

(fixes #3216, BP from #3130) fixed to use config file setting for is_allow_web_public_flag_age

Revision 590e463b (diff)
Added by Yuya Watanabe over 10 years ago

fixed to use config file setting for sns_config.yml setings (fixes #3216, BP from #3130)

History

#1 Updated by Yuya Watanabe about 11 years ago

  • Priority changed from Normal(通常) to Low(低め)

#2 Updated by Chiharu Nakajima over 10 years ago

  • Target version changed from OpenPNE 3.6.x to OpenPNE 3.6.9

#3 Updated by Yuya Watanabe over 10 years ago

  • Status changed from New(新規) to Accepted(着手)
  • Assignee set to Yuya Watanabe

#4 Updated by Yuya Watanabe over 10 years ago

  • Status changed from Accepted(着手) to Pending Review(レビュー待ち)
  • % Done changed from 0 to 50

更新履歴 3c856d101e7c56c337fc7c80b7c5e2b6b92d3ae0 で適用されました。

#5 Updated by Rimpei Ogawa over 10 years ago

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

親チケットを差し戻しました。
https://redmine.openpne.jp/issues/3130#note-6

#6 Updated by Yuya Watanabe over 10 years ago

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

更新履歴 590e463bccac8a764bb1e391f37b3c9f90ffca7b で適用されました。

#7 Updated by Rimpei Ogawa over 10 years ago

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

#8 Updated by Yuya Watanabe over 10 years ago

  • Description updated (diff)

#9 Updated by Yuya Watanabe over 10 years ago

  • Subject changed from 管理画面「Web 全体への年齢公開許可設定」のデフォルト値を変更しても設定に反映されない to 管理画面「Web 全体への年齢公開許可設定」および「メンバーのプロフィールページ公開範囲設定」のデフォルト値を変更しても設定に反映されない

#10 Updated by Chiharu Nakajima over 10 years ago

  • Status changed from Pending Testing(テスト待ち) to Fixed(完了)
  • % Done changed from 70 to 100

動作確認しました。
問題ありません。

Also available in: Atom PDF