magento / magento/magento-coding-standard

Forbid Framework\Module\Status::setIsEnabled

Open
#424 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Progress: ready for grooming proposal
Dominant language
PHP
Stars
375
Forks
165
PR merge metrics
No merged PRs in 30d

Description

### 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ForbiddenFunctionsSniff and inspect how forbidden function calls are configured and verified in this coding standard. Add coverage for Magento\Framework\Module\Status::setIsEnabled, preserving the stated exception for console command handlers, and confirm that the prohibited production usage is rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.