テーマをコピーした際にヘルパーの重複エラーが表示される #3978#4102
Conversation
|
@IwasakiRyuichi changePluginNameSpace や、changePluginClassName と処理がほぼ一緒ですので統合できないか一度考えてみてください。 |
|
@ryuring 修正内容 確認したい点 |
…内にHelperのnamespaceとclassnameの変更処理を移動
|
BcUtillに定義していたヘルパーのnamespaceとclassの変更処理を、ThemeServiceの方に移動しました。 |
ryuring
left a comment
There was a problem hiding this comment.
@IwasakiRyuichi レビューいれました!
| $pluginPath = BcUtil::getPluginPath($newTheme); | ||
| if (!$pluginPath) return false; | ||
| if(file_exists($pluginPath . 'src/view/helper' . DS . 'Helper.php')) { | ||
| $helperClassPath = $pluginPath . 'stc/view/helper' . DS . $newTheme . 'Helper.php'; |
There was a problem hiding this comment.
src が stc になってます。
また、View と Helperはキャメルケースにしないと、linux環境では動作しないです。
(macは、大文字小文字を判別しないので動作します)
There was a problem hiding this comment.
stcの箇所をsrcに修正しました。
ViewとHelperの修正ですが、view⇨View、helper⇨Helperのように修正しましたが、あってますでしょうか?・・
| { | ||
| $pluginPath = BcUtil::getPluginPath($newTheme); | ||
| if (!$pluginPath) return false; | ||
| $oldTypePath = $pluginPath . 'src/View/Helper' . DS . 'Helper.php'; |
There was a problem hiding this comment.
@IwasakiRyuichi $oldTypePath が存在することはないのでこちらは削除で大丈夫です。
| $pluginPath = BcUtil::getPluginPath($newTheme); | ||
| if (!$pluginPath) return false; | ||
| $oldTypePath = $pluginPath . 'src/View/Helper' . DS . 'Helper.php'; | ||
| $oldPath = $pluginPath . 'src/View/Helper' . DS . $oldTheme . 'Helper.php'; |
There was a problem hiding this comment.
@IwasakiRyuichi / と DS が混在しています。全て DS で統一しなければ、DS を使っている意味がないです。統一しましょう。
'src' . DS . 'View' . DS . 'Helper'
| { | ||
| $pluginPath = BcUtil::getPluginPath($newTheme); | ||
| if (!$pluginPath) return false; | ||
| if(file_exists($pluginPath . 'src/View/Helper' . DS . 'Helper.php')) { |
There was a problem hiding this comment.
ファイルパスの見直し、$oldTypePathの削除、373行目の判定削除の修正行いました。
今までDSの概念を分からずにいましたが、DSのおかげで異なるOS間でもファイルパスを適切にできることを知ることができました・・・ありがとうございます。
@ryuring
大変お待たせしました。コピーしたテーマが正常にフロント画面に表示されるようになりましたのでご確認よろしくお願いします。