Skip to content

Commit

Permalink
Fixed empty levels value in array
Browse files Browse the repository at this point in the history
  • Loading branch information
darinlarimore committed Mar 8, 2022
1 parent b2cc762 commit bd15947
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## 1.0.2 - 2022-03-08
### Added
- Fixed Composer.json links

## 1.0.3 - 2022-03-08
### Fixed
- Fixed empty levels value in array
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "trendyminds/craft-paper-trail",
"description": "A plugin to connect Craft logs to Papertrail.",
"type": "craft-plugin",
"version": "1.0.2",
"version": "1.0.3",
"keywords": [
"craft",
"cms",
Expand Down
10 changes: 6 additions & 4 deletions src/CraftPapertrail.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ protected function addComponents()
$request = Craft::$app->getRequest();
if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest() && !$request->getIsLivePreview()) {
$levels = [
$this->settings->debug ? 'trace' : '',
$this->settings->info ? 'info' : '',
$this->settings->warning ? 'warning' : '',
$this->settings->error ? 'error' : '',
$this->settings->debug ? 'trace' : null,
$this->settings->info ? 'info' : null,
$this->settings->warning ? 'warning' : null,
$this->settings->error ? 'error' : null,
];

$levels = array_filter($levels);

$this->set('profileTarget', [
'class' => PapertrailTarget::class,
'levels' => $levels,
Expand Down
2 changes: 1 addition & 1 deletion src/templates/_macros.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% macro configWarning(setting) -%}
{{ 'This is being overridden by the `{setting}` config setting.'|markdown(inlineOnly=true) }}
{{ "This is being overridden by the `#{setting}` config setting."|markdown(inlineOnly=true) }}
{%- endmacro %}

0 comments on commit bd15947

Please sign in to comment.