mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 06:47:46 -08:00
Check for asset before attempting to cite mismatch
This commit is contained in:
parent
4f1747023a
commit
25b8c4438e
|
@ -67,15 +67,16 @@ class MigrateDenormedAssetLocations extends Migration
|
||||||
|
|
||||||
$unassigned_assets=Asset::whereNull("location_id")->get();
|
$unassigned_assets=Asset::whereNull("location_id")->get();
|
||||||
foreach($unassigned_assets as $unassigned_asset) {
|
foreach($unassigned_assets as $unassigned_asset) {
|
||||||
\Log::info('Asset: ".$unassigned_asset->id." still has no location');
|
\Log::info('Asset: '.$unassigned_asset->id.' still has no location');
|
||||||
}
|
}
|
||||||
|
|
||||||
Asset::all()->each(function ($asset) {
|
Asset::get()->each(function ($asset) {
|
||||||
if($asset->location_id != $asset->assetLoc()->id) {
|
if (($asset) && ($asset->location_id != $asset->assetLoc()->id)) {
|
||||||
\Log::info('MISMATCH MISMATCH '.$asset->id. "doesn't match its location");
|
\Log::info('MISMATCH MISMATCH '.$asset->id. "doesn't match its location");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue