Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2]サブディレクトリにEC-CUBEをインストールすると,管理画面の商品画像が読み込めなくなるのを修正 #5417

Merged
merged 3 commits into from
Jul 10, 2022

Conversation

nanasess
Copy link
Contributor

@nanasess nanasess commented Jul 1, 2022

概要(Overview・Refs Issue)

  • https://example.com/path/to/ec-cube/ にインストールした場合、/path/to/ec-cube/path/to/ec-cube/html/upload/save_image 以下の画像を参照していたのを修正
  • お支払い方法管理の画像も同様

方針(Policy)

image_save_realdir 及び image_temp_realdir からのファイル名を参照するよう修正

実装に関する補足(Appendix)

str_starts_with() 関数は PHP7.4 でも symfony/polyfill-php80 によって利用できるようになっている。 composer.json に明示的に追加しておいた方がよいか?

テスト(Test)

サブディレクトリにインストールしたEC-CUBEで画像を正常に表示できるのを確認

相談(Discussion)

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更はありません
  • フックポイントの呼び出しタイミングの変更はありません
  • フックポイントのパラメータの削除・データ型の変更はありません
  • twigファイルに渡しているパラメータの削除・データ型の変更はありません
  • Serviceクラスの公開関数の、引数の削除・データ型の変更はありません
  • 入出力ファイル(CSVなど)のフォーマット変更はありません

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか
    • 権限を超えた操作が可能にならないか
    • 不要なファイルアップロードがないか
    • 外部へ公開されるファイルや機能の追加ではないか
    • テンプレートでのエスケープ漏れがないか

@nanasess nanasess changed the title サブディレクトリにEC-CUBEをインストールすると,管理画面の商品画像が読み込めなくなるのを修正 [4.2]サブディレクトリにEC-CUBEをインストールすると,管理画面の商品画像が読み込めなくなるのを修正 Jul 1, 2022
@chihiro-adachi
Copy link
Contributor

@nanasess
save_dir、temp_dirからのファイル名をやり取りすればよいかなと思いましたがどうでしょうか。
chihiro-adachi@09c8407

@chihiro-adachi chihiro-adachi added this to the 4.2.0 milestone Jul 5, 2022
@nanasess
Copy link
Contributor Author

nanasess commented Jul 7, 2022

@chihiro-adachi ありがとうございます。いただいた修正でいけそうでしたので、支払方法設定も同様に対応しました。

@codecov-commenter
Copy link

Codecov Report

Merging #5417 (abaf129) into 4.2 (9f37496) will decrease coverage by 0.02%.
The diff coverage is 44.44%.

@@             Coverage Diff              @@
##                4.2    #5417      +/-   ##
============================================
- Coverage     53.04%   53.01%   -0.03%     
  Complexity     6155     6155              
============================================
  Files           466      466              
  Lines         20932    20938       +6     
============================================
- Hits          11104    11101       -3     
- Misses         9828     9837       +9     
Flag Coverage Δ
E2E 49.47% <44.44%> (-0.03%) ⬇️
Unit 11.34% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ontroller/Admin/Setting/Shop/PaymentController.php 53.03% <0.00%> (-1.24%) ⬇️
...ube/Controller/Admin/Product/ProductController.php 71.83% <88.88%> (+0.17%) ⬆️
...orage/Handler/SameSiteNoneCompatSessionHandler.php 76.11% <0.00%> (-2.99%) ⬇️
.../Eccube/Form/Type/Admin/ProductClassMatrixType.php 86.11% <0.00%> (-2.78%) ⬇️
...rc/Eccube/Form/Type/Admin/ProductClassEditType.php 87.01% <0.00%> (-1.30%) ⬇️
...ontroller/Admin/Product/ProductClassController.php 80.57% <0.00%> (-1.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f37496...abaf129. Read the comment docs.

@chihiro-adachi
Copy link
Contributor

@nanasess
ありがとうございます。マージしました。

@nanasess nanasess deleted the fix-image-load branch October 3, 2022 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants