mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-27 06:29:47 -08:00
Merge pull request #10861 from andreaci/develop
next_audit_date error on saving asset
This commit is contained in:
commit
edcf109b0f
|
@ -17,12 +17,15 @@ class AssetObserver
|
|||
*/
|
||||
public function updating(Asset $asset)
|
||||
{
|
||||
|
||||
$attributes = $asset->getAttributes();
|
||||
$attributesOriginal = $asset->getAttributes();
|
||||
|
||||
// If the asset isn't being checked out or audited, log the update.
|
||||
// (Those other actions already create log entries.)
|
||||
if (($asset->getAttributes()['assigned_to'] == $asset->getOriginal()['assigned_to'])
|
||||
&& ($asset->getAttributes()['next_audit_date'] == $asset->getOriginal()['next_audit_date'])
|
||||
&& ($asset->getAttributes()['last_checkout'] == $asset->getOriginal()['last_checkout'])) {
|
||||
if (($attributes['assigned_to'] == $attributesOriginal['assigned_to'])
|
||||
&& ((isset( $attributes['next_audit_date']) ? $attributes['next_audit_date'] : null) == (isset($attributesOriginal['next_audit_date']) ? $attributesOriginal['next_audit_date']: null))
|
||||
&& ($attributes['last_checkout'] == $attributesOriginal['last_checkout'])) {
|
||||
|
||||
$changed = [];
|
||||
|
||||
foreach ($asset->getOriginal() as $key => $value) {
|
||||
|
|
Loading…
Reference in a new issue