Pantheon Community

Drupal 7 status report on the Pantheon dashboard

The system status as reported on the ‘Status’ page on the dashboard uses hook_requirements() in Drupal 7. Some modules’ implementations are not very robust, e.g. the in the commerce_stripe module it looks for the location of the Stripe PHP library, but doesn’t allow hook_libraries_info_alter() to run, so if the library’s in a non-standard location, it reports an error incorrectly.

There’s unfortunately no alter function invoked after hook_requirements(), so it’s not possible to change the output until it reaches the theme layer. When viewed on a Drupal site, we can do this via template_preprocess_status_report(), but when triggered via Drush (as is presumably the case on Pantheon’s ‘Status’ page), it’s more difficult.

Has anyone had any success in overriding the output of the status report on the dashboard?

2 Likes

Hey @DavidSparks, great question.

I’ve never tried it, but the docs to detail how you could hook alter drush commands
see:

So I would think you could at least alter the results in the same fashion as you’re doing on the front-end.

Thanks @doug_pantheon - that’s helpful.

I’m having a bit of difficulty seeing how to implement the alter hook. I can’t seem to find any info on how to register the class, or what to name it / where to put it if it gets registered automatically.

The command itself can be altered with hook_drush_command_alter, so I could simply create my own version of the command. But it would probably be better to alter the output of the core command. The docs for Drush 8 don’t seem to explain how to do this, unfortunately…