Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import not updating Category Assets #14915

Open
2 tasks done
jayavman opened this issue Jun 20, 2024 · 10 comments
Open
2 tasks done

Import not updating Category Assets #14915

jayavman opened this issue Jun 20, 2024 · 10 comments
Labels
❓ not sure if bug This issue has not been confirmed as a bug yet

Comments

@jayavman
Copy link

Debug mode

Describe the bug

Importer not updating category asset

Reproduction steps

Screenshot 2024-06-20 174317
add "IT" to category as asset

Screenshot 2024-06-20 174351
Import new category on existing asset
Screenshot 2024-06-20 174336
verify asset has changed to new category,

Did not change. Tried many times changing assets to different category's and they just dont work via import.

Only thing in debug :

str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in asset/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 75

Expected behavior

Importing changes to category's should change asset to the assigned category.

Screenshots

No response

Snipe-IT Version

v7.0.4 build 14011 (g20d558785)

Operating System

almalinux

Web Server

apache

PHP Version

8.1.29

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

@snipe
Copy link
Owner

snipe commented Jun 20, 2024

If you set debug to true and tail the log at the time you're running the import, does that show you anything useful? We have some more verbose output there IIRC.

@jayavman
Copy link
Author

jayavman commented Jun 20, 2024

select * from users where id = 1 and users.deleted_at is null limit 1
810μsfredons_assetEloquentUserProvider.php#59
select permission_groups., users_groups.user_id as pivot_user_id, users_groups.group_id as pivot_group_id from permission_groups inner join users_groups on permission_groups.id = users_groups.group_id where users_groups.user_id = 1
480μsfredons_assetUser.php#147
select * from custom_fields
380μsfredons_assetAssetsController.php#123
select count(
) as aggregate from assets inner join status_labels as status_alias on status_alias.id = assets.status_id where assets.deleted_at is null
3.81msfredons_assetAssetsController.php#386
select count() as aggregate from assets inner join status_labels as status_alias on status_alias.id = assets.status_id where assets.deleted_at is null
3.69msfredons_assetAssetsController.php#389
select assets.
from assets inner join status_labels as status_alias on status_alias.id = assets.status_id where assets.deleted_at is null order by name asc limit 300 offset 0
3.07msfredons_assetAssetsController.php#390
select * from locations where locations.id in (38, 49, 50, 51, 303, 314, 322, 324, 376, 377, 378, 381, 382, 383, 430, 534, 537, 698, 897, 1166) and locations.deleted_at is null
700μsfredons_assetAssetsController.php#390
select * from status_labels where status_labels.id in (12, 14, 15, 16, 17, 18) and status_labels.deleted_at is null
670μsfredons_assetAssetsController.php#390
select * from companies where companies.id in (1)
510μsfredons_assetAssetsController.php#390
select * from locations where locations.id in (38, 49, 50, 51, 303, 314, 322, 324, 376, 377, 378, 381, 382, 383, 430, 534, 537, 698, 897, 1166) and locations.deleted_at is null
680μsfredons_assetAssetsController.php#390
select * from models where models.id in (18, 23, 108, 109, 148, 149, 196, 222, 223, 229, 230, 231, 512, 548, 621, 667, 668, 672, 688, 689, 812)
700μsfredons_assetAssetsController.php#390
select * from categories where categories.id in (25, 27, 28, 29, 49, 50) and categories.deleted_at is null
460μsfredons_assetAssetsController.php#390
select * from manufacturers where manufacturers.id in (22, 33, 37, 47, 55, 99, 110) and manufacturers.deleted_at is null
310μsfredons_assetAssetsController.php#390
select * from custom_fieldsets where custom_fieldsets.id in (2)
270μsfredons_assetAssetsController.php#390
select * from suppliers where suppliers.id in (7, 11) and suppliers.deleted_at is null
380μsfredons_assetAssetsController.php#390
select custom_fields.*, custom_field_custom_fieldset.custom_fieldset_id as pivot_custom_fieldset_id, custom_field_custom_fieldset.custom_field_id as pivot_custom_field_id, custom_field_custom_fieldset.required as pivot_required, custom_field_custom_fieldset.order as pivot_order from custom_fields inner join custom_field_custom_fieldset on custom_fields.id = custom_field_custom_fieldset.custom_field_id where custom_field_custom_fieldset.custom_fieldset_id = 2 order by pivot_order asc
730μsfredons_assetAssetsTransformer.php#102
select * from depreciations where depreciations.id = 1 limit 1
570μsfredons_assetAsset.php#452
select * from depreciations where depreciations.id = 2 limit 1
640μsfredons_assetAsset.php#452
select * from depreciations where depreciations.id = 2 limit 1

i do get flooded alot by the
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in endor/laravel/framework/src/Illuminate/Support/helpers.php on line 75

@snipe
Copy link
Owner

snipe commented Jun 20, 2024

No I mean tailing the log file itself as you click on Import. tail -f storage/logs/laravel.log via command line

@jayavman
Copy link
Author

[2024-06-20 23:09:01] production.WARNING: User ID 1 initiated a PURGE!
[2024-06-20 23:22:37] production.ERROR: ErrorException: Attempt to read property "id" on null in /home/fredons/public_html/asset/app/Importer/AssetImporter.php: 24
Stack trace:
#0 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Found ation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\Handl eExceptions->handleError(2, 'Attempt to read...', '/home/fredons/p...', 24)
#1 /home/fredons/public_html/asset/app/Importer/AssetImporter.php(24): Illuminat e\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap{closur e}(2, 'Attempt to read...', '/home/fredons/p...', 24)
#2 /home/fredons/public_html/asset/app/Http/Requests/ItemImportRequest.php(43): App\Importer\AssetImporter->__construct('/home/fredons/p...')
#3 /home/fredons/public_html/asset/app/Http/Controllers/Api/ImportController.php (176): App\Http\Requests\ItemImportRequest->import(Object(App\Models\Import))
#4 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Controller.php(54): App\Http\Controllers\Api\ImportController->process(Object (App\Http\Requests\ItemImportRequest), '99')
#5 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction('proc ess', Array)
#6 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Route.php(260): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illu minate\Routing\Route), Object(App\Http\Controllers\Api\ImportController), 'proce ss')
#7 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Route.php(205): Illuminate\Routing\Route->runController()
#8 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Router.php(806): Illuminate\Routing\Route->run()
#9 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipel ine/Pipeline.php(144): Illuminate\Routing\Router->Illuminate\Routing{closure}(O bject(Illuminate\Http\Request))
#10 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Middleware/ThrottleRequests.php(159): Illuminate\Pipeline\Pipeline->Illumina te\Pipeline{closure}(Object(Illuminate\Http\Request))
#11 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Middleware/ThrottleRequests.php(135): Illuminate\Routing\Middleware\Throttle Requests->handleRequest(Object(Illuminate\Http\Request), Object(Closure), Array)
#12 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Middleware/ThrottleRequests.php(87): Illuminate\Routing\Middleware\ThrottleR equests->handleRequestUsingNamedLimiter(Object(Illuminate\Http\Request), Object( Closure), 'api', Object(Closure))
#13 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Routing\Middleware\ThrottleRequests->handle(O bject(Illuminate\Http\Request), Object(Closure), 'api')
#14 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Auth /Middleware/Authenticate.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipel ine{closure}(Object(Illuminate\Http\Request))
#15 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Auth\Middleware\Authenticate->handle(Object(I lluminate\Http\Request), Object(Closure), 'api')
#16 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closu re}(Object(Illuminate\Http\Request))
#17 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(807): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#18 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(784): Illuminate\Routing\Router->runRouteWithinStack(Object(Illum inate\Routing\Route), Object(Illuminate\Http\Request))
#19 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(748): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\ Request), Object(Illuminate\Routing\Route))
#20 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(737): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminat e\Http\Request))
#21 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Kernel.php(200): Illuminate\Routing\Router->dispatch(Object(Illumina te\Http\Request))
#22 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(144): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation \Http{closure}(Object(Illuminate\Http\Request))
#23 /home/fredons/public_html/asset/vendor/livewire/livewire/src/DisableBrowserC ache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object (Illuminate\Http\Request))
#24 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Livewire\DisableBrowserCache->handle(Object(Illuminate\H ttp\Request), Object(Closure))
#25 /home/fredons/public_html/asset/vendor/barryvdh/laravel-debugbar/src/Middlew are/InjectDebugbar.php(66): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{c losure}(Object(Illuminate\Http\Request))
#26 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle(Obje ct(Illuminate\Http\Request), Object(Closure))
#27 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Http /Middleware/HandleCors.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipelin e{closure}(Object(Illuminate\Http\Request))
#28 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Http\Middleware\HandleCors->handle(Object(Ill uminate\Http\Request), Object(Closure))
#29 /home/fredons/public_html/asset/app/Http/Middleware/PreventBackHistory.php(2 3): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminat e\Http\Request))
#30 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\PreventBackHistory->handle(Object(Il luminate\Http\Request), Object(Closure))
#31 /home/fredons/public_html/asset/app/Http/Middleware/SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\H ttp\Request))
#32 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\SecurityHeaders->handle(Object(Illum inate\Http\Request), Object(Closure))
#33 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline-> Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#34 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\ Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Objec t(Closure))
#35 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\ConvertEmptyString sToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /home/fredons/public_html/asset/app/Http/Middleware/CheckForDebug.php(25): I lluminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Htt p\Request))
#37 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\CheckForDebug->handle(Object(Illumin ate\Http\Request), Object(Closure))
#38 /home/fredons/public_html/asset/app/Http/Middleware/CheckForSetup.php(25): I lluminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Htt p\Request))
#39 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\CheckForSetup->handle(Object(Illumin ate\Http\Request), Object(Closure))
#40 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/View /Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illumi nate\Pipeline{closure}(Object(Illuminate\Http\Request))
#41 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\View\Middleware\ShareErrorsFromSession->handl e(Object(Illuminate\Http\Request), Object(Closure))
#42 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Sess ion/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\P ipeline{closure}(Object(Illuminate\Http\Request))
#43 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Sess ion/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession- >handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Sessio n\Store), Object(Closure))
#44 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Session\Middleware\StartSession->handle(Objec t(Illuminate\Http\Request), Object(Closure))
#45 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\Pipe line\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#46 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\PreventRequestsDur ingMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#47 /home/fredons/public_html/asset/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Ht tp\Request))
#48 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\NoSessionStore->handle(Object(Illumi nate\Http\Request), Object(Closure))
#49 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closu re}(Object(Illuminate\Http\Request))
#50 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#51 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThrou ghRouter(Object(Illuminate\Http\Request))
#52 /home/fredons/public_html/asset/public/index.php(52): Illuminate\Foundation\ Http\Kernel->handle(Object(Illuminate\Http\Request))
#53 {main}
[2024-06-20 23:22:37] production.ERROR: Attempt to read property "id" on null {" userId":1,"exception":"[object] (ErrorException(code: 0): Attempt to read proper ty "id" on null at /home/fredons/public_html/asset/app/Importer/AssetImporter. php:24)
[stacktrace]
#0 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Found ation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\Ha ndleExceptions->handleError(2, 'Attempt to read...', '/home/fredons/p...', 24)
#1 /home/fredons/public_html/asset/app/Importer/AssetImporter.php(24): Illuminat e\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{ closure}(2, 'Attempt to read...', '/home/fredons/p...', 24)
#2 /home/fredons/public_html/asset/app/Http/Requests/ItemImportRequest.php(43): App\Importer\AssetImporter->__construct('/home/fredons/p...')
#3 /home/fredons/public_html/asset/app/Http/Controllers/Api/ImportController.php (176): App\Http\Requests\ItemImportRequest->import(Object(App\Models\Import ))
#4 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Controller.php(54): App\Http\Controllers\Api\ImportController->process(Ob ject(App\Http\Requests\ItemImportRequest), '99')
#5 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction('pr ocess', Array)
#6 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Route.php(260): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Il luminate\Routing\Route), Object(App\Http\Controllers\Api\ImportController) , 'process')
#7 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Route.php(205): Illuminate\Routing\Route->runController()
#8 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Routi ng/Router.php(806): Illuminate\Routing\Route->run()
#9 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipel ine/Pipeline.php(144): Illuminate\Routing\Router->Illuminate\Routing\{closur e}(Object(Illuminate\Http\Request))
#10 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Middleware/ThrottleRequests.php(159): Illuminate\Pipeline\Pipeline->Illumi nate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#11 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Middleware/ThrottleRequests.php(135): Illuminate\Routing\Middleware\Throt tleRequests->handleRequest(Object(Illuminate\Http\Request), Object(Closure), A rray)
#12 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Middleware/ThrottleRequests.php(87): Illuminate\Routing\Middleware\Thrott leRequests->handleRequestUsingNamedLimiter(Object(Illuminate\Http\Request), Ob ject(Closure), 'api', Object(Closure))
#13 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Routing\Middleware\ThrottleRequests->handl e(Object(Illuminate\Http\Request), Object(Closure), 'api')
#14 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Auth /Middleware/Authenticate.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pi peline\{closure}(Object(Illuminate\Http\Request))
#15 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Auth\Middleware\Authenticate->handle(Objec t(Illuminate\Http\Request), Object(Closure), 'api')
#16 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{c losure}(Object(Illuminate\Http\Request))
#17 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(807): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#18 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(784): Illuminate\Routing\Router->runRouteWithinStack(Object(Ill uminate\Routing\Route), Object(Illuminate\Http\Request))
#19 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(748): Illuminate\Routing\Router->runRoute(Object(Illuminate\Ht tp\Request), Object(Illuminate\Routing\Route))
#20 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Rout ing/Router.php(737): Illuminate\Routing\Router->dispatchToRoute(Object(Illumin ate\Http\Request))
#21 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Kernel.php(200): Illuminate\Routing\Router->dispatch(Object(Illumi nate\Http\Request))
#22 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(144): Illuminate\Foundation\Http\Kernel->Illuminate\Founda tion\Http\{closure}(Object(Illuminate\Http\Request))
#23 /home/fredons/public_html/asset/vendor/livewire/livewire/src/DisableBrowserC ache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Ob ject(Illuminate\Http\Request))
#24 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Livewire\DisableBrowserCache->handle(Object(Illuminate\ \Http\Request), Object(Closure))
#25 /home/fredons/public_html/asset/vendor/barryvdh/laravel-debugbar/src/Middlew are/InjectDebugbar.php(66): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline \{closure}(Object(Illuminate\Http\Request))
#26 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle(O bject(Illuminate\Http\Request), Object(Closure))
#27 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Http /Middleware/HandleCors.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipe line\{closure}(Object(Illuminate\Http\Request))
#28 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Http\Middleware\HandleCors->handle(Object( Illuminate\Http\Request), Object(Closure))
#29 /home/fredons/public_html/asset/app/Http/Middleware/PreventBackHistory.php(2 3): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illum inate\Http\Request))
#30 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\PreventBackHistory->handle(Object (Illuminate\Http\Request), Object(Closure))
#31 /home/fredons/public_html/asset/app/Http/Middleware/SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illumina te\Http\Request))
#32 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\SecurityHeaders->handle(Object(Il luminate\Http\Request), Object(Closure))
#33 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline ->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation \Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\ConvertEmptySt ringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /home/fredons/public_html/asset/app/Http/Middleware/CheckForDebug.php(25): I lluminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate \Http\Request))
#37 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\CheckForDebug->handle(Object(Illu minate\Http\Request), Object(Closure))
#38 /home/fredons/public_html/asset/app/Http/Middleware/CheckForSetup.php(25): I lluminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate \Http\Request))
#39 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\CheckForSetup->handle(Object(Illu minate\Http\Request), Object(Closure))
#40 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/View /Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illu minate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\View\Middleware\ShareErrorsFromSession->ha ndle(Object(Illuminate\Http\Request), Object(Closure))
#42 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Sess ion/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate \Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Sess ion/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSessi on->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\ Session\Store), Object(Closure))
#44 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Session\Middleware\StartSession->handle(Ob ject(Illuminate\Http\Request), Object(Closure))
#45 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\Pip eline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Reques t))
#46 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\PreventRequest sDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#47 /home/fredons/public_html/asset/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminat e\Http\Request))
#48 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(183): App\Http\Middleware\NoSessionStore->handle(Object(Ill uminate\Http\Request), Object(Closure))
#49 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Pipe line/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{c losure}(Object(Illuminate\Http\Request))
#50 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then(Object(Closure ))
#51 /home/fredons/public_html/asset/vendor/laravel/framework/src/Illuminate/Foun dation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestTh roughRouter(Object(Illuminate\Http\Request))
#52 /home/fredons/public_html/asset/public/index.php(52): Illuminate\Foundation \Http\Kernel->handle(Object(Illuminate\Http\Request))
#53 {main}
"}

@snipe
Copy link
Owner

snipe commented Jun 20, 2024

That code is:

if (!is_null(Statuslabel::first())) {
            $this->defaultStatusLabelId = Statuslabel::deployable()->first()->id;
        }

It cannot find a deployable status label, and a status label was not provided in the import.

snipe added a commit that referenced this issue Jun 20, 2024
Signed-off-by: snipe <snipe@snipe.net>
@jayavman
Copy link
Author

jayavman commented Jun 20, 2024

Why does it need to be deployable to change a category? Shouldn't we be able to change a category for any status (even archived or undeployable)

Also when importing you only need the asset number as the reference. I loaded the exact csv in as per demo at the top of my post ast and category

@snipe
Copy link
Owner

snipe commented Jun 20, 2024

We only use that default status label on asset creation (when no status label was provided), not on updating.

// If no status ID is found
if (! array_key_exists('status_id', $this->item) && ! $editingAsset) {
$this->log('No status ID field found, defaulting to first deployable status label.');
$this->item['status_id'] = $this->defaultStatusLabelId;
}

@jayavman
Copy link
Author

jayavman commented Jun 21, 2024

@snipe tried the possible fix still an issue with me
Screenshot 2024-06-21 221631
Screenshot 2024-06-21 221611
says its updated after i import, but when i go to the asset, it still has "Speakers" as the category and not "Audio"

snipe added a commit that referenced this issue Jun 21, 2024
…r_defaultStatusLabel

Possible fix for #14915 - error on import when status label is not provided and no deployable statuses can be found
@snipe snipe added the ❓ not sure if bug This issue has not been confirmed as a bug yet label Jun 22, 2024
@snipe
Copy link
Owner

snipe commented Jun 25, 2024

Again, that should only fire if it you're creating a new asset, so I think it's seeing the assets as new, not existing.

@jpflanegan
Copy link

I know what your problem is because I had the same problem and figured it out.

Categories are assigned to asset models and not assets directly. If you want to change the category of the asset you have to change the category of the Assets Model. I have been struggling with this for a while trying to update categories via import and eventually realised it is related to the Assets Model and not the asset itself.

Not ideal as I would have liked to have had different categories for the same model. I am rather going to create a custom field to store the categories I want and keep and thing about the Asset Model category. The reason I wanted this seperation is because we have a central budget for the bulk of our assets but departments can fund their own assets as well. I wanted to have seperate categories for Department Laptops and Central Laptops so I could easily see the numbers we had of each category on the Dashboard.

I'm definitely not going to duplicate each asset model, that would be to much work maintaining that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ not sure if bug This issue has not been confirmed as a bug yet
Projects
None yet
Development

No branches or pull requests

3 participants