magento-coding-standard icon indicating copy to clipboard operation
magento-coding-standard copied to clipboard

Forbid Framework\Module\Status::setIsEnabled

Open maaarghk opened this issue 2 years ago • 1 comments

Rule

Forbid calling Magento\Framework\Module\Status::setIsEnabled

Reason

Experienced downtime as a result of a magento marketplace module (feefo/reviews) calling setIsEnabled(true) in production mode. The target was Magento_Review, which was installed but not enabled, causing blocks to attempt to load data from database tables which did not exist (declarative schema had removed them). Usage of this function outwith console command handlers should result in an automated knockback from the Magento marketplace due to potential to cause downtime like this.

Implementation

ForbiddenFunctionsSniff

maaarghk avatar Oct 10 '22 16:10 maaarghk

Hi @maaarghk. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Oct 10 '22 16:10 m2-assistant[bot]