Problem/Motivation
I have a need to suppress certain warnings on hosts where I can't control the php.ini. https://www.drupal.org/project/nagios/issues/2900271 and https://www.drupal.org/project/nagios/issues/3295094 are examples of other users needing to suppress warnings but I think there should be a generalized solution.
Since `hook_requirements_alter` already exists, this patch adds support for calling that hook when checking requirements.
Steps to reproduce
Create a module that uses `hook_requirements_alter`. When viewing the GUI status report, the hook will be respected. When calling the nagios module, it isn't.
Issue fork nagios-3558586
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tunicAs I understand the idea is to mimic core behaviour, so after collecting all requirements give the change to alter them (in this case probably to remove them), right?
This sounds like the way to go. I would like to think about it just in case there is some edge case that I'm not aware of. Like, for current installations this may break any current workflow or way to use the module? I can't think on any. to be honest.
Also, @gogowitsch, if you read this, what do you think?
Comment #4
gogowitsch commentedThanks for the issue and the PR, megaphonejon!
The motivation is clear and the code change looks fine. Within the next 10 days, I’ll build a local test setup just to get a better feeling.
I am hopeful nothing blocking will show up and I can merge this then.
Comment #8
gogowitsch commentedI manually tested the proposed change. All looked good. I invented a requirement 'funky' to then silence it using this code:
Thanks again, megaphonejon!