プロジェクト

全般

プロフィール

Backport(バックポート) #1580

A community category is sorted not in order of column sort_order of table community_category but in order of ID. (コミュニティカテゴリがテーブルcommunity_categoryのカラムsort_orderではなく、ID順にソートされる)

Masato Nagasawa13年以上前に追加. 13年以上前に更新.

ステータス:
Fixed(完了)
優先度:
Normal(通常)
担当者:
対象バージョン:
開始日:
2010-08-25
期日:
進捗率:

100%


説明

Overview (現象)

2系から3系へアップデートのアップデート時に以下の操作を行うと、コミュニティカテゴリがテーブルcommunity_categoryのカラムsort_orderではなく、ID順にソートされる

前提
 ・2.12のときに、コミュニティカテゴリのIDとsort_orderの並びが違う状態
 (後から追加し、カテゴリ的には既存のものより上にしたいため)

結果
・そのデータをupgrade する
・OpenPNE3で参照しているテーブルcommunity_categoryのカラムsort_order ではなく、ID順にソートされてプルダウンメニューに表示される

再現バージョン

  • OpenPNE2.12 → 3.4.6

Causes (原因)

community_category テーブルからレコードを取得する際のSQLで、sort_order カラムを order by に指定していない。

Way to fix (修正内容)

community_category を取得する際、随所で以下のようなコードとなっている。

Doctrine::getTable('CommunityCategory')->createQuery()->where('lft > 1');

where句の指定はすべて共通であるため、CommunityCategoryTable に getAllChildrenQuery() を追加して共通化し、
このメソッド内で「order by sort_order」を付加するように修正する。

報告元

http://sns.openpne.jp/diary/24997 から転載

2.12から3.4.6へアップデートした環境で、

前提
 ・2.12のときに、コミュニティカテゴリのIDとsort_orderの並びが違う状態
 (後から追加し、カテゴリ的には既存のものより上にしたいため)

結果
・そのデータをupgrade する
・OpenPNE3で参照しているテーブルcommunity_categoryのカラムsort_order ではなく、ID順にソートされてプルダウンメニューに表示される


関連するチケット

関連している OpenPNE 3 - Bug(バグ) #1528: A community category is sorted not in order of column sort_order of table community_category but in order of ID. (コミュニティカテゴリがテーブルcommunity_categoryのカラムsort_orderではなく、ID順にソートされる) Fixed(完了) 2010-08-25
関連している OpenPNE 3 - Backport(バックポート) #1581: A community category is sorted not in order of column sort_order of table community_category but in order of ID. (コミュニティカテゴリがテーブルcommunity_categoryのカラムsort_orderではなく、ID順にソートされる) Fixed(完了) 2010-08-25
関連している OpenPNE 3 - Bug(バグ) #1783: #1580のカテゴリのソート順の修正が不十分である Invalid(無効) 2010-11-16

関係しているリビジョン

リビジョン 73216fc3 (差分)
Masato Nagasawa13年以上前に追加

fixed sort of the community category. (fixes #1580 BP from #1528)

リビジョン e67c4466 (差分)
Masato Nagasawa13年以上前に追加

fixed updated unit test of the community category table class. (fixes #1580 BP from #1528)

履歴

#1 Masato Nagasawa13年以上前に更新

  • 題名コミュニティカテゴリがテーブルcommunity_categoryのカラムsort_orderではなく、ID順にソートされる から A community category is sorted not in order of column sort_order of table community_category but in order of ID. (コミュニティカテゴリがテーブルcommunity_categoryのカラムsort_orderではなく、ID順にソートされる) に変更

#2 Masato Nagasawa13年以上前に更新

  • ステータスAccepted(着手) から Pending Review(レビュー待ち) に変更
  • 進捗率0 から 50 に変更

更新履歴 73216fc3611b8a9a252f8bacc3c1c5f838a91668 で適用されました。

#3 Shogo Kawahara13年以上前に更新

  • ステータスPending Review(レビュー待ち) から Rejected(差し戻し) に変更

#1528 差し戻しによるステータス変更

#4 Masato Nagasawa13年以上前に更新

  • ステータスRejected(差し戻し) から Pending Review(レビュー待ち) に変更

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

#5 Hiroki Mogi13年以上前に更新

テスト実施しました。正常に動作していました。

#6 Shogo Kawahara13年以上前に更新

  • ステータスPending Review(レビュー待ち) から Pending Testing(テスト待ち) に変更
  • 進捗率50 から 70 に変更

#7 Hiroki Mogi13年以上前に更新

  • ステータスPending Testing(テスト待ち) から Fixed(完了) に変更
  • 進捗率70 から 100 に変更

テスト実施済みですので、チケットをfixします。

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