プロジェクト

全般

プロフィール

Bug(バグ) #2461

Yuya Watanabe12年以上前に更新

h3. Overview (現象)

携帯版プロフィール画面 (/member/profile)にて、自己紹介の項目名が表示されない。

!mobile_frontend-member-profile.png!
「よ ろ し く ね」という内容が表示されている項目が自己紹介。

h5. 現象確認バージョン

OpenPNE 3.6RC2
OpenPNE 3.7.0-dev (master)

h3. Causes (原因)

下記部分においてフォームのタイプがtextareaかつpresetだった場合にcaptionの追加がなされていない.この条件に該当するものが「自己紹介」だけとなるため「自己紹介」のみが表示されない状態となっている.

apps/mobile_frontend/modules/member/templates/profileSuccess.php 59行目〜
<pre>
59 if ('textarea' === $profile->getFormType())
60 {
61 $value = op_auto_link_text_for_mobile((string)$profile);
62 }
63 elseif ($profile->getProfile()->isPreset())
64 {
65 $presetConfig = $profile->getProfile()->getPresetConfig();
66 $caption = __($presetConfig['Caption']);
67 if ('country_select' === $profile->getFormType())
68 {
69 $value = __($culture->getCountry((string)$profile));
70 }
71 elseif ('op_preset_birthday' === $profile->getName())
72 {
73 $value = op_format_date((string)$profile, 'XShortDateJa');
74 }
75 else
76 {
77 $value = __((string)$profile);
78 }
79 }
</pre>



h3. Way to fix (修正内容)

<pre>
diff --git a/apps/mobile_frontend/modules/member/templates/profileSuccess.php b/apps/mobile_frontend/modules/member/templates/profileSuccess.php
index 5f0d9c6..b018ffb 100644
--- a/apps/mobile_frontend/modules/member/templates/profileSuccess.php
+++ b/apps/mobile_frontend/modules/member/templates/profileSuccess.php
@@ -56,11 +56,7 @@ foreach ($member->getProfiles(true) as $profile)
continue;
}

- if ('textarea' === $profile->getFormType())
- {
- $value = op_auto_link_text_for_mobile((string)$profile);
- }
- elseif ($profile->getProfile()->isPreset())
+ if ($profile->getProfile()->isPreset())
{
$presetConfig = $profile->getProfile()->getPresetConfig();
$caption = __($presetConfig['Caption']);
@@ -78,6 +74,11 @@ foreach ($member->getProfiles(true) as $profile)
}
}

+ if ('textarea' === $profile->getFormType())
+ {
+ $value = op_auto_link_text_for_mobile($value);
+ }
+
if ($member->getId() == $sf_user->getMemberId())
{
if ($profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_FRIEND)
</pre>

戻る