Bug(バグ) #2420
Minoru Takai が12年以上前に更新
h3. 現象
sfOpenPNEFriendAction クラスに不要なメンバ定義が含まれたままになっている。具体的な記述内容は commit:0df5d28e の差分を見ると分かる。 に不要なメソッド定義などがコミットされている
OpenPNE3.6.x 以降 sfOpenPNEFriendAction クラスは、OpenPNE-3.5.0 時点での修正 commit:c1072092 により は
下位互換性を保つためのもので、
必要な修正は opFriendAction クラスに実装が移動しており、このクラス自体は後方互換性のために残している。 クラスで行っていくべきものです。
<pre>
<?php
/**
* This class is for keeping backward compatibility.
*
* If you want to add new feature to this class, please add this to
* the opFriendAction class, a parent class of this class.
* And of course using this class is deprecated. You should not begin to
* use this class, and you have to replace the code that is using this class.
*/
abstract class sfOpenPNEFriendAction extends opFriendAction
{
public function preExecute()
{
(中略)
}
}
</pre>
このクラスの実装は上記のように、クラスの継承のみで、メンバの定義は一切記述されていないべきである。 このクラスのメソッド定義は削除し、opFriendAction クラスを
継承しているのみの状態が正しい状態と思います
h3. 原因
* (a) 1個目のコミット 2009/12/22 (OpenPNE-3.3.2) commit:8772766f
* (b) 2個目のコミット 2009/12/28 (OpenPNE-3.3.2) commit:69a6e482
* (c) 別のコミット 2010/03/03 (OpenPNE-3.5.0) commit:c1072092
* (d) 3個目のコミット 2010/12/28 (OpenPNE-3.7.0) commit:70cb7314 不要なバックポートのコミットが原因
#368 のチケットでは上記の流れでコミットが行われている。
* (a), (b) では sfOpenPNEFriendAction クラスのメソッドを修正している commit:0df5d28e
* (c) では sfOpenPNEFriendAction クラスを opFriendAction クラスに変更し、後方互換性(※)のために sfOpenPNEFriendAction クラスを残している
** ※ 新しいバージョンにおいて、古いバージョンの仕様を前提にコードが書けること(ここでは sfOpenPNEFriendAction クラスを使えるようにしておくこと)を意味する
* (d) では、 (c) の修正を前提に opFriendAction クラスのメソッドを修正している commit:41fbb553
つまり、 (a), (b) のコミットは (c) のコミットよりも前であることが前提となっている。
しかし #2190 では (c) のコミット後に (a), (b) をバックポートで取り込んでおり、逆に言えば (a), (b) のコミット後に (c) のコミットが無いために sfOpenPNEFriendAction クラスにメソッド定義が残っているという状況となっている。
h3. 修正内容
sfOpenPNEFriendAction クラスのメソッド定義を削除し、 opFriendAction を継承するのみの状態に戻す。おそらく #2190 の commit:0df5d28e, commit:41fbb553 を revert すればよい。 を継承するのみの状態に戻す
h3. 対象バージョン
OpenPNE-3.6RC1 ( stable-3.6.x ブランチ) OpenPNE3.6RC1 でのみ発生、3.7では問題ない
sfOpenPNEFriendAction クラスに不要なメンバ定義が含まれたままになっている。具体的な記述内容は commit:0df5d28e の差分を見ると分かる。 に不要なメソッド定義などがコミットされている
OpenPNE3.6.x 以降 sfOpenPNEFriendAction クラスは、OpenPNE-3.5.0 時点での修正 commit:c1072092 により は
下位互換性を保つためのもので、
必要な修正は opFriendAction クラスに実装が移動しており、このクラス自体は後方互換性のために残している。 クラスで行っていくべきものです。
<pre>
<?php
/**
* This class is for keeping backward compatibility.
*
* If you want to add new feature to this class, please add this to
* the opFriendAction class, a parent class of this class.
* And of course using this class is deprecated. You should not begin to
* use this class, and you have to replace the code that is using this class.
*/
abstract class sfOpenPNEFriendAction extends opFriendAction
{
public function preExecute()
{
(中略)
}
}
</pre>
このクラスの実装は上記のように、クラスの継承のみで、メンバの定義は一切記述されていないべきである。 このクラスのメソッド定義は削除し、opFriendAction クラスを
継承しているのみの状態が正しい状態と思います
h3. 原因
* (a) 1個目のコミット 2009/12/22 (OpenPNE-3.3.2) commit:8772766f
* (b) 2個目のコミット 2009/12/28 (OpenPNE-3.3.2) commit:69a6e482
* (c) 別のコミット 2010/03/03 (OpenPNE-3.5.0) commit:c1072092
* (d) 3個目のコミット 2010/12/28 (OpenPNE-3.7.0) commit:70cb7314 不要なバックポートのコミットが原因
#368 のチケットでは上記の流れでコミットが行われている。
* (a), (b) では sfOpenPNEFriendAction クラスのメソッドを修正している commit:0df5d28e
* (c) では sfOpenPNEFriendAction クラスを opFriendAction クラスに変更し、後方互換性(※)のために sfOpenPNEFriendAction クラスを残している
** ※ 新しいバージョンにおいて、古いバージョンの仕様を前提にコードが書けること(ここでは sfOpenPNEFriendAction クラスを使えるようにしておくこと)を意味する
* (d) では、 (c) の修正を前提に opFriendAction クラスのメソッドを修正している commit:41fbb553
つまり、 (a), (b) のコミットは (c) のコミットよりも前であることが前提となっている。
しかし #2190 では (c) のコミット後に (a), (b) をバックポートで取り込んでおり、逆に言えば (a), (b) のコミット後に (c) のコミットが無いために sfOpenPNEFriendAction クラスにメソッド定義が残っているという状況となっている。
h3. 修正内容
sfOpenPNEFriendAction クラスのメソッド定義を削除し、 opFriendAction を継承するのみの状態に戻す。おそらく #2190 の commit:0df5d28e, commit:41fbb553 を revert すればよい。 を継承するのみの状態に戻す
h3. 対象バージョン
OpenPNE-3.6RC1 ( stable-3.6.x ブランチ) OpenPNE3.6RC1 でのみ発生、3.7では問題ない