Project

General

Profile

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順にソートされる)

Added by pnetan   over 13 years ago. Updated about 8 years ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Target version:
Start date:
2010-08-25
Due date:
% Done:

100%

3.6 で発生するか:
Yes
3.8 で発生するか:
Unknown (未調査)

Description

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順にソートされてプルダウンメニューに表示される


Related issues

Related to OpenPNE 3 - 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順にソートされる) Fixed(完了) 2010-08-25
Related to 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
Related to OpenPNE 3 - Enhancement(機能追加・改善) #1591: support to the sorting order change of the community categories (コミュニティカテゴリのソート順を変更できるようにする) Won't fix(対応せず) 2010-09-14
Related to OpenPNE 3 - Bug(バグ) #1796: 2系から3系へアップデートでコミュニティカテゴリの管理画面でのソート順の対処がされていない [3.6系限定] Fixed(完了) 2010-11-17

Associated revisions

Revision b103b3be (diff)
Added by Masato Nagasawa about 13 years ago

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

Revision 9020cea8 (diff)
Added by Masato Nagasawa about 13 years ago

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

History

#1 Updated by Rimpei Ogawa over 13 years ago

  • 3.6 で発生するか set to Yes

#2 Updated by Masato Nagasawa about 13 years ago

  • Status changed from New(新規) to Accepted(着手)
  • Assignee set to Masato Nagasawa

#3 Updated by Masato Nagasawa about 13 years ago

  • Target version set to OpenPNE 3.7.0

現状カテゴリのソートカラムにはnullが入っているため、
nullのカテゴリについては1より順番が上になります。
コミュニティカテゴリのソート順自体変更する機構が存在していないため、
これについては別チケットで対応する必要があると思います。

#4 Updated by Masato Nagasawa about 13 years ago

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

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

#5 Updated by Masato Nagasawa about 13 years ago

  • Subject changed from コミュニティカテゴリがテーブルcommunity_categoryのカラムsort_orderではなく、ID順にソートされる to 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順にソートされる)

#6 Updated by Shogo Kawahara about 13 years ago

  • Status changed from Pending Review(レビュー待ち) to Rejected(差し戻し)
  • CommunityCategoryTable に対する UnitTestが更新されていません。

#7 Updated by Masato Nagasawa about 13 years ago

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

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

#8 Updated by Shogo Kawahara about 13 years ago

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

#9 Updated by Fumie Toyooka about 12 years ago

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

テスト無事終了しました。

#10 Updated by kaoru n about 8 years ago

  • 3.8 で発生するか set to Unknown (未調査)

Also available in: Atom PDF