Fatal Error When using the filter for disabling a module

Open Beginner friendly
#712 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php, wordpress
Domain
backend

Research direction

Start by locating hello_elementor_tweak_settings() and the Theme::get_module() call it uses; the issue does not name their file or a test. Trace how the documented hello-plus-theme/modules/admin-home/is-active filter can leave the module unavailable, then check the existing tests or add coverage for that case. Done means disabling the module no longer causes a null get_component() call on front-end or admin requests.

Written by the indexing model from the issue text.

Description

When using the documented filter for disabling a module, You will get a 500 error

  add_filter( 'hello-plus-theme/modules/admin-home/is-active', '__return_false' );

when using the filter i noticed fatal error

Theme::get_module() returns null, and hello_elementor_tweak_settings() on init calls ->get_component() on null:

Call to a member function get_component() on null 

Every front-end and admin request dies, there should be a guard for a null module

Dominant language
PHP
Stars
614
Forks
240
Avg merge
4h 17m
Merged PRs (30d)
9

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from elementor/hello-theme

All issues in elementor/hello-theme

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.