プロジェクト

全般

プロフィール

Bug(バグ) #3937

管理画面の「アクティビティの連続投稿禁止時間」の値を変更しても連続投稿禁止時間が変化しない

Youichi Kimuraほぼ8年前に追加. ほぼ8年前に更新.

ステータス:
Pending Review(レビュー待ち)
優先度:
Normal(通常)
担当者:
対象バージョン:
開始日:
2016-04-27
期日:
進捗率:

50%

3.6 で発生するか:
Yes (はい)
[QA]バグ通知済:
いいえ
3.8 で発生するか:
Unknown (未調査)

説明

Overview (現象)

管理画面の「アクティビティの連続投稿禁止時間」はデフォルトで 30 秒となっているが、この値を 1 秒や 60 秒に変更しても設定したとおりの時間にならず常に 30 秒で連続投稿が制限される。

Causes (原因)

source:lib/services/opOpenSocialActivityService.class.php@6d81bffd#L185

      if (sfConfig::get('opensocial_activity_post_limit_time', 30))
      {
        $object = Doctrine::getTable('ActivityData')->createQuery()
          ->where('foreign_table = ?', Doctrine::getTable('Application')->getTableName())
          ->andWhere('foreign_id = ?', $memberApplication->getApplicationId())
          ->andWhere('member_id = ?', $member->getId())
          ->orderBy('created_at DESC')
          ->fetchOne();
        if ($object)
        {
          $interval = time() - strtotime($object->getCreatedAt());
          if ($interval < sfConfig::get('opensocial_activity_post_limit_time', 30))
          {
            throw new SocialSpiException("Service Unavailable", 503);
          }
        }
      }

「アクティビティの連続投稿禁止時間」の設定値は上記の箇所で使用されているが、この設定は sns_config テーブルに格納される値であるため sfConfig ではなく opConfig ないし Doctrine_Core::getTable('SnsConfig')->get() を使わなければ期待した値を取得することができない。

Way to fix (修正内容)

sfConfig::get('opensocial_activity_post_limit_time', 30) としている箇所を Doctrine_Core::getTable('SnsConfig')->get('opensocial_activity_post_limit_time', 30) に変更する。

履歴

#1 Youichi Kimuraほぼ8年前に更新

  • ステータスNew(新規) から Pending Review(レビュー待ち) に変更
  • 担当者Youichi Kimura にセット
  • 進捗率0 から 50 に変更

下記 Pull Request にて修正しました。
https://github.com/openpne-ospt/opOpenSocialPlugin/pull/26

他の形式にエクスポート: Atom PDF