mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -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();
|
||||
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) {
|
||||
if($asset->location_id != $asset->assetLoc()->id) {
|
||||
\Log::info('MISMATCH MISMATCH '.$asset->id. "doesn't match its location");
|
||||
Asset::get()->each(function ($asset) {
|
||||
if (($asset) && ($asset->location_id != $asset->assetLoc()->id)) {
|
||||
\Log::info('MISMATCH MISMATCH '.$asset->id. "doesn't match its location");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue