Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Olde Hampsink committed Oct 31, 2016
2 parents e312b16 + e2dd9b7 commit 391b8ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AuditLogPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getName()
*/
public function getVersion()
{
return '0.7.0';
return '0.7.1';
}

/**
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ phpunit --bootstrap craft/app/tests/bootstrap.php --configuration craft/plugins/

Changelog
=================
###0.7.1###
- Fix comparing of non-existing attribute before, closing issue #15

###0.7.0###
- Added Craft 2.5 compatibility
- Refactored plugin for better readability, quality and testability
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"email": "b.oldehampsink@itmundi.nl"
}
],
"license": "MIT",
"type": "craft-plugin",
"require": {
"composer/installers": "~1.0"
Expand Down
6 changes: 3 additions & 3 deletions services/AuditLogService.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public function view($id)
// Set parsed values
$diff[$handle] = array(
'label' => $item['label'],
'changed' => ($item['value'] != $log['before'][$handle]['value']),
'changed' => !isset($log['before'][$handle]) || ($item['value'] != $log['before'][$handle]['value']),
'after' => $item['value'],
'before' => $log['before'][$handle]['value'],
'before' => isset($log['before'][$handle]) ? $log['before'][$handle]['value'] : '',
);
}

Expand Down Expand Up @@ -162,7 +162,7 @@ public function elementHasChanged($elementType, $id, $before, $after)
// Add labels once again
$diff = array();
foreach ($expanded as $key => $value) {
$diff[$key]['label'] = $before[$key]['label'];
$diff[$key]['label'] = isset($before[$key]) ? $before[$key]['label'] : '';
$diff[$key]['value'] = $value['value'];
}

Expand Down

0 comments on commit 391b8ec

Please sign in to comment.