Skip to content

Commit

Permalink
Fixed #3507
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Nov 29, 2018
1 parent 0079d9b commit 7016ee3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed
- Fixed a bug where new Matrix blocks wouldn’t remember that they were supposed to be collapsed if “Save and continue editing” was clicked. ([#3499](https://github.com/craftcms/cms/issues/3499))
- Fixed an error that occurred on the System Report utility if any non-bootstrapped modules were configured with an array or callable rather than a string. ([#3507](https://github.com/craftcms/cms/issues/3507))

## 3.0.33 - 2018-11-27

Expand Down
4 changes: 2 additions & 2 deletions src/templates/_components/utilities/SystemReport.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ <h2>{{ 'Modules'|t('app') }}</h2>
{% if modules|length %}
<table class="data fullwidth fixed-layout">
<tbody>
{% for id, module in modules %}
{% for id, class in modules %}
<tr>
<th class="light">{{ id }}</th>
<td>{{ module.id is defined ? className(module) : module }}</td>
<td>{{ class }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
20 changes: 19 additions & 1 deletion src/utilities/SystemReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
namespace craft\utilities;

use Craft;
use craft\base\PluginInterface;
use craft\base\Utility;
use craft\helpers\App;
use GuzzleHttp\Client;
use Imagine\Gd\Imagine;
use RequirementsChecker;
use Twig_Environment;
use Yii;
use yii\base\Module;

/**
* SystemReport represents a SystemReport dashboard widget.
Expand Down Expand Up @@ -56,10 +58,26 @@ public static function iconPath()
*/
public static function contentHtml(): string
{
$modules = [];
foreach (Craft::$app->getModules() as $id => $module) {
if ($module instanceof PluginInterface) {
continue;
}
if ($module instanceof Module) {
$modules[$id] = get_class($module);
} else if (is_string($module)) {
$modules[$id] = $module;
} else if (is_array($module) && isset($module['class'])) {
$modules[$id] = $module['class'];
} else {
$modules[$id] = Craft::t('app', 'Unknown type');
}
}

return Craft::$app->getView()->renderTemplate('_components/utilities/SystemReport', [
'appInfo' => self::_appInfo(),
'plugins' => Craft::$app->getPlugins()->getAllPlugins(),
'modules' => Craft::$app->getModules(),
'modules' => $modules,
'requirements' => self::_requirementResults(),
]);
}
Expand Down

0 comments on commit 7016ee3

Please sign in to comment.