プラグインでSC_Plugin_Baseを継承するとシステムエラーが発生する
- Dominant language
- PHP
- Stars
- 92
- Forks
- 97
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
### 概要
2.17.2で、SC_Plugin_Baseを継承したプラグインをインストール・有効化するとシステムエラーが発生する
```
Fatal error(E_COMPILE_ERROR): Cannot make static method SC_Plugin_Base::install() non static in class SamplePlugin on [/http://check/eccube-2.17.2-mysql/data/downloads/plugin/SamplePlugin/SamplePlugin.php(xx)] from xxx.xxx.xxx.xxx
login_id = testadmin(0)[eca3e814]
```
### 原因
以下の変更に起因するもの。
PHP8対応 #405
https://github.com/EC-CUBE/ec-cube2/pull/405/files#diff-e3893a4908e7945ee32224a3e23f4bd79752fd68785f97ad37246e1c115aff87
### 回避方法
SC_Plugin_Base を継承せずにマジックメソッドを使用することで回避が可能。
https://gist.github.com/nanasess/6447bfd9e3cd26815c9ce7d0e8b1cb71
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the SC_Plugin_Base changes in PHP8対応 #405 and the failing SamplePlugin.php path shown in the error. Compare the inherited install and enable behavior with the workaround linked in the issue. Done means a plugin inheriting SC_Plugin_Base can be installed and enabled without the PHP fatal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100