-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Comments
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. |
select * from i do get flooded alot by the |
No I mean tailing the log file itself as you click on Import. |
[2024-06-20 23:09:01] production.WARNING: User ID 1 initiated a PURGE! |
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. |
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 |
We only use that default status label on asset creation (when no status label was provided), not on updating. snipe-it/app/Importer/AssetImporter.php Lines 87 to 91 in 30c1e1e
|
@snipe tried the possible fix still an issue with me |
…r_defaultStatusLabel Possible fix for #14915 - error on import when status label is not provided and no deployable statuses can be found
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. |
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. |
Debug mode
Describe the bug
Importer not updating category asset
Reproduction steps
add "IT" to category as asset
Import new category on existing asset
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
The text was updated successfully, but these errors were encountered: