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

Textarea custom field not showing in asset creation screen up after updating to 6.0.1 #11120

Closed
2 tasks done
benseroussi opened this issue May 17, 2022 · 48 comments
Closed
2 tasks done
Assignees
Labels
❓ not sure if bug This issue has not been confirmed as a bug yet

Comments

@benseroussi
Copy link

Debug mode

Describe the bug

Old server ubuntu 20.0 with snipe it 5.4.4, php 7.4
I created a new server with ubuntu 22.04, snipeit 6.0.1 and php 8.0.19.
Restored backup and everything seems to be ok but when creating new asset custom field won't show up.

Also just to add, first a made a new windows server and also had the issue. both in the new windows server and the ubuntu restore from GUI didn't work (also the upload didn't do anything).
Restoe with php artisan snipeit:restore only worked on the ubuntu, it's not configured correctl for windows.

Reproduction steps

  1. new 6.0.1 server
    2.restore from 5.4.4 backup

...

Expected behavior

When choosing the right model custom fields shows up

Screenshots

No response

Snipe-IT Version

6.0.1

Operating System

ubuntu 22.04

Web Server

Apache

PHP Version

8.0.19

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

13:37:23] LOG.error: ErrorException: Undefined variable $item in /var/www/snipe-it/storage/framework/views/c2f92f5963c671e2b8055449d54aa36ce4783176.php:16

[13:37:23] LOG.error: Undefined variable $item (View: /var/www/snipe-it/resources/views/models/custom_fields_form.blade.php)

Additional context

No response

@welcome
Copy link

welcome bot commented May 17, 2022

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@benseroussi benseroussi changed the title Custom fields not showing up after updaing to 6.0.1 Custom fields not showing up after updating to 6.0.1 May 17, 2022
@snipe
Copy link
Owner

snipe commented May 17, 2022

I'm not able to reproduce this locally. Investigating further on our end, but in the meantime, have you tried running:

php artisan cache:clear
php artisan config:clear
php artisan view:clear
composer dump-autoload

?

@benseroussi
Copy link
Author

I run:

php artisan migrate
php artisan config:clear

As per the migrate guide.
I just tried all your commands, still the same issue.

Thanks for the quick reply.

@snipe
Copy link
Owner

snipe commented May 17, 2022

I can't reproduce this on the demo either... https://demo.snipeitapp.com/hardware/create (MacBook Pro 13" has a fieldset associated with it)

@benseroussi
Copy link
Author

I can't load any backup there so I cant test it myself. but it did happens on 2 different new set ups so maybe it's something to do with the original install.

The original server is still accessible , I created a new one because updating to 6 failed with various errors, the server itself is working fine.

I'm trying to restore a backup(fresh install) I just took before restoring my old backup but it also fails. I wanted to checked if the custom fields are woking correctly.

@snipe
Copy link
Owner

snipe commented May 17, 2022

I'm trying to restore a backup(fresh install) I just took before restoring my old backup but it also fails

Could you be more specific? We've updated many of our hosted users without any issues.

@benseroussi
Copy link
Author

benseroussi commented May 17, 2022

I just finished installing the server about 2 hours ago. before restoring my 5.4.4 backup I made a backup.
Trying to restore it I get this error:
Error
Undefined constant "STDIN"

its from vendor/symfony/console/Helper/QuestionHelper.php:113
$inputStream = $this->inputStream ?: \STDIN;

Thats an improvment, when I tried restoring from the GUI before all I got was error 500.

PS.
I followed this guide for the install:
https://idroot.us/install-snipe-it-ubuntu-20-04/

@snipe
Copy link
Owner

snipe commented May 17, 2022

How were you trying to restore? Via cli or web UI?

@snipe
Copy link
Owner

snipe commented May 17, 2022

Also is there any more to that stack trace?

@benseroussi
Copy link
Author

Via web UI I get this error.
Via CLI it's working fine (on ubuntu the script is no fit for windows).

I just used the CLI to go back to the original backup and its working fine. Going to mine and the problem returns. Is there a way to migrate the custom fields, assests and licenses manually without the restore?
I can get you the backup if it will help you test stuff.

@benseroussi
Copy link
Author

Also is there any more to that stack trace?

Yes, it was too long to post, what to do with it?

@snipe
Copy link
Owner

snipe commented May 17, 2022

Just tail the log and only include the new stuff that shows up when you try to run it.

@benseroussi
Copy link
Author

Just tail the log and only include the new stuff that shows up when you try to run it.

Everything is new, anyways thats 1:
[14:23:42] LOG.error: ErrorException: Undefined variable $item in /var/www/snipe-it/storage/framework/views/c2f92f5963c671e2b8055449d54aa36ce4783176.php:16
Stack trace:
#0 /var/www/snipe-it/storage/framework/views/c2f92f5963c671e2b8055449d54aa36ce4783176.php(16): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(107): require('...')
#2 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(108): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem{closure}()
#3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire()
#4 /var/www/snipe-it/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(69): Illuminate\View\Engines\PhpEngine->evaluatePath()
#5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(61): Livewire\CompilerEngineForIgnition->evaluatePath()
#6 /var/www/snipe-it/vendor/facade/ignition/src/Views/Engines/CompilerEngine.php(37): Illuminate\View\Engines\CompilerEngine->get()
#7 /var/www/snipe-it/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(35): Facade\Ignition\Views\Engines\CompilerEngine->get()
#8 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/View.php(139): Livewire\CompilerEngineForIgnition->get()
#9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\View\View->getContents()
#10 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\View\View->renderContents()
#11 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\View\View->render()
#12 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\Http\Response->setContent()
#13 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(820): Illuminate\Http\Response->__construct()
#14 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(789): Illuminate\Routing\Router::toResponse()
#15 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Router->prepareResponse()
#16 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}()
#17 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#18 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Auth\Middleware\Authenticate->handle()
#19 /var/www/snipe-it/app/Http/Middleware/AssetCountForSidebar.php(55): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#20 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\AssetCountForSidebar->handle()
#21 /var/www/snipe-it/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#22 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\Passport\Http\Middleware\CreateFreshApiToken->handle()
#23 /var/www/snipe-it/app/Http/Middleware/CheckForTwoFactor.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#24 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForTwoFactor->handle()
#25 /var/www/snipe-it/app/Http/Middleware/CheckUserIsActivated.php(47): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#26 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckUserIsActivated->handle()
#27 /var/www/snipe-it/app/Http/Middleware/CheckLocale.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#28 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckLocale->handle()
#29 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#30 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#31 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#32 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#33 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#34 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#35 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#36 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\Pipeline\Pipeline->then()
#37 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\Routing\Router->runRouteWithinStack()
#38 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRoute()
#39 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\Routing\Router->dispatchToRoute()
#40 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch()
#41 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}()
#42 /var/www/snipe-it/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#43 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\DisableBrowserCache->handle()
#44 /var/www/snipe-it/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#45 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle()
#46 /var/www/snipe-it/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#47 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle()
#48 /var/www/snipe-it/app/Http/Middleware/PreventBackHistory.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#49 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\PreventBackHistory->handle()
#50 /var/www/snipe-it/app/Http/Middleware/SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#51 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SecurityHeaders->handle()
#52 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#53 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#54 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#55 /var/www/snipe-it/app/Http/Middleware/CheckForDebug.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#56 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForDebug->handle()
#57 /var/www/snipe-it/app/Http/Middleware/CheckForSetup.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#58 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForSetup->handle()
#59 /var/www/snipe-it/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#60 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle()
#61 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#62 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#63 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#64 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#65 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle()
#66 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#67 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#68 /var/www/snipe-it/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#69 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\NoSessionStore->handle()
#70 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#71 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then()
#72 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#73 /var/www/snipe-it/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#74 {main}

Next Facade\Ignition\Exceptions\ViewException: Undefined variable $item (View: /var/www/snipe-it/resources/views/models/custom_fields_form.blade.php) in /var/www/snipe-it/resources/views/models/custom_fields_form.blade.php:15
Stack trace:
#0 /var/www/snipe-it/resources/views/models/custom_fields_form.blade.php(15): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(107): require('...')
#2 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(108): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem{closure}()
#3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire()
#4 /var/www/snipe-it/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(69): Illuminate\View\Engines\PhpEngine->evaluatePath()
#5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(61): Livewire\CompilerEngineForIgnition->evaluatePath()
#6 /var/www/snipe-it/vendor/facade/ignition/src/Views/Engines/CompilerEngine.php(37): Illuminate\View\Engines\CompilerEngine->get()
#7 /var/www/snipe-it/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(35): Facade\Ignition\Views\Engines\CompilerEngine->get()
#8 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/View.php(139): Livewire\CompilerEngineForIgnition->get()
#9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\View\View->getContents()
#10 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\View\View->renderContents()
#11 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\View\View->render()
#12 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\Http\Response->setContent()
#13 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(820): Illuminate\Http\Response->__construct()
#14 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(789): Illuminate\Routing\Router::toResponse()
#15 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Router->prepareResponse()
#16 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}()
#17 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#18 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Auth\Middleware\Authenticate->handle()
#19 /var/www/snipe-it/app/Http/Middleware/AssetCountForSidebar.php(55): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#20 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\AssetCountForSidebar->handle()
#21 /var/www/snipe-it/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#22 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\Passport\Http\Middleware\CreateFreshApiToken->handle()
#23 /var/www/snipe-it/app/Http/Middleware/CheckForTwoFactor.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#24 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForTwoFactor->handle()
#25 /var/www/snipe-it/app/Http/Middleware/CheckUserIsActivated.php(47): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#26 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckUserIsActivated->handle()
#27 /var/www/snipe-it/app/Http/Middleware/CheckLocale.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#28 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckLocale->handle()
#29 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#30 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#31 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#32 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#33 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#34 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#35 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#36 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\Pipeline\Pipeline->then()
#37 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\Routing\Router->runRouteWithinStack()
#38 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRoute()
#39 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\Routing\Router->dispatchToRoute()
#40 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch()
#41 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}()
#42 /var/www/snipe-it/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#43 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\DisableBrowserCache->handle()
#44 /var/www/snipe-it/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#45 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle()
#46 /var/www/snipe-it/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#47 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle()
#48 /var/www/snipe-it/app/Http/Middleware/PreventBackHistory.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#49 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\PreventBackHistory->handle()
#50 /var/www/snipe-it/app/Http/Middleware/SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#51 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SecurityHeaders->handle()
#52 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#53 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#54 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#55 /var/www/snipe-it/app/Http/Middleware/CheckForDebug.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#56 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForDebug->handle()
#57 /var/www/snipe-it/app/Http/Middleware/CheckForSetup.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#58 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForSetup->handle()
#59 /var/www/snipe-it/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#60 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle()
#61 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#62 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#63 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#64 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#65 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle()
#66 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#67 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#68 /var/www/snipe-it/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#69 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\NoSessionStore->handle()
#70 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#71 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then()
#72 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#73 /var/www/snipe-it/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#74 {main}

@benseroussi
Copy link
Author

The 2nd seems to have a lot of company info so just me know if it's needed.

@snipe
Copy link
Owner

snipe commented May 17, 2022

Does the restore fail when you run it via cli as well?

@benseroussi
Copy link
Author

On the ubuntu machine(the one I'm currently using) it works fine.

On the windows it can't find mysql because the path in the php script looks for /mysql which is for linux. After fixing that I had error 22 invalid argument. In the end I restored the db directly and the folder manually and then got the custom fields bug.

@snipe
Copy link
Owner

snipe commented May 17, 2022

It actually uses the DB_DUMP_PATH from the .env that's used in the backup process.

@benseroussi
Copy link
Author

I sort of solved the issue. I took the c2f92f5963c671e2b8055449d54aa36ce4783176.php from my old server and replaced it with the new one and it fixed the issue, I guess that was a change between the version which causes it with the old DB.
Attaching the files so you can check.
php.zip

@benseroussi
Copy link
Author

benseroussi commented May 17, 2022

It actually uses the DB_DUMP_PATH from the .env that's used in the backup process.

I know, and it work diffrently with linux and windows.
linux dump path is /usr/bin with the script addion turns to /usr/bin/mysql which works fine.
windows dump is c:\progra~\mariadb\bin and with teh script addion it turns to :\progra~\mariadb\bin/mysql which is invalid. /i changed it in the script to add \mysql and was still invalid. in the end /mysql.exe worked.

Maybe you will want ot add scome OS check to the script.

I'm away from teh computer for now, so my next reply won't be so quick. Big thanks for the quick replys and you help!

@snipe
Copy link
Owner

snipe commented May 17, 2022

Of course it does, that's why we document the ways to find out the different paths.
https://snipe-it.readme.io/docs/configuration#required-database-settings

Screen Shot 2022-05-17 at 4 57 03 AM

I know for sure that people have been able to use the backup command on windows - I cannot speak to the restore, since we don't run windows here. :-/

Snipe-IT Documentation
This section is where you edit the Snipe-IT configuration file to reflect your own settings, such as your database credentials, mail server, preferred language, timezone, and so on. Some of the settings are optional, some are required. Don't be intimidated by the length of this page. The configurati...

@benseroussi
Copy link
Author

The backup on windows works, the restore doesn't.
I set up windows originally because we are mainly windows organization and if one day I'll leave not sure if anyone will handle the snipe-it. It didn't go so smoothly so I'll stick to linux.

Did you manage to take a look on the php files and figure out what caused my issue?

@snipe
Copy link
Owner

snipe commented May 17, 2022

I am working on something else at the moment.

@snipe snipe added the ❓ not sure if bug This issue has not been confirmed as a bug yet label May 17, 2022
@uberbrady
Copy link
Collaborator

The differences, once I yank out whitespace, are pretty minor - just one about textareas and trying to do a 'graceful decrypt' in the newer version.

My thought is that maybe we are running in to the 'custom field naming change' problem?

You can maybe test by doing this:

Run php artisan tinker:

Then try this:

App\Models\CustomField::all()->pluck('name','db_column')

In the output, look for those column names in your database in the Assets table - are they there?

@uberbrady
Copy link
Collaborator

Then try running this (also in tinker) -

App\Models\CustomField::all()->map(function ($item) { return $item->convertUnicodeDbSlug(); })

Do the names match up?

@benseroussi
Copy link
Author

I don't know how to check for it in the data base, the output was all my custom fields:
>>> App\Models\CustomField::all()->pluck('name','db_column') => Illuminate\Support\Collection {#5629 all: [ "_snipeit_mac_address_1" => "MAC Address", "_snipeit_ip_2" => "IP", "_snipeit_prod_virtual_location_3" => "Prod Virtual Location", "_snipeit_site_4" => "Site", "_snipeit_backup_schedule_5" => "Backup Schedule", "_snipeit_replication_required_6" => "Replication required", "_snipeit_dr_exercise_7" => "DR exercise", "_snipeit_application_8" => "Application", "_snipeit_department_9" => "Department", "_snipeit_dr_virtual_location_10" => "DR Virtual location", "_snipeit_vm_description_11" => "VM Description", "_snipeit_os_12" => "OS", "_snipeit_contained_databases_13" => "Contained Databases", "_snipeit_sql_version_14" => "SQL Version", "_snipeit_database_applications_15" => "Database Applications", "_snipeit_special_monitorings_17" => "Special Monitorings", ], }

@snipe
Copy link
Owner

snipe commented May 18, 2022

I sort of solved the issue. I took the c2f92f5963c671e2b8055449d54aa36ce4783176.php from my old server and replaced it with the new one and it fixed the issue

Those are cached files - you don't want to carry them over as they get overwritten over time.

@benseroussi
Copy link
Author

benseroussi commented May 18, 2022

App\Models\CustomField::all()->map(function ($item) { return $item->convertUnicodeDbSlug(); })

This is with the old php(the working one):
>>> App\Models\CustomField::all()->map(function ($item) { return $item->convertUnicodeDbSlug(); }) => Illuminate\Support\Collection {#5630 all: [ "_snipeit_mac_address_1", "_snipeit_ip_2", "_snipeit_prod_virtual_location_3", "_snipeit_site_4", "_snipeit_backup_schedule_5", "_snipeit_replication_required_6", "_snipeit_dr_exercise_7", "_snipeit_application_8", "_snipeit_department_9", "_snipeit_dr_virtual_location_10", "_snipeit_vm_description_11", "_snipeit_os_12", "_snipeit_contained_databases_13", "_snipeit_sql_version_14", "_snipeit_database_applications_15", "_snipeit_special_monitorings_17", ], }

Same with both phps

@benseroussi
Copy link
Author

I sort of solved the issue. I took the c2f92f5963c671e2b8055449d54aa36ce4783176.php from my old server and replaced it with the new one and it fixed the issue

Those are cached files - you don't want to carry them over as they get overwritten over time.

I'll assume this file wasn't in the backup as it was new, that means when it was created in 6 something didn't play right with the 5.4 settings.

@snipe
Copy link
Owner

snipe commented May 18, 2022

Caches files are never included in the generated backup, since the system generates them as needed.

@benseroussi
Copy link
Author

So I narrowed down the issue, as long as I have any custom field est as textra with the new php (or after deleting the file) the error shows up.
With the old php everything is fine.
Can you try to recreate it?
delete /var/www/[snipeit bath]/storage/framework/views/c2f92f5963c671e2b8055449d54aa36ce4783176.php
and try to create any assest with a model that has assigned textra custom field.

@benseroussi
Copy link
Author

So it seems the cache file /var/www/[snipeit bath]/storage/framework/views/c2f92f5963c671e2b8055449d54aa36ce4783176.php is create from the file /var/www/snipe-it/resources/views/models/custom_fields_form.blade.php
Once I swapped the 6.0.1 with the old 5.4 custome_fields_form.blade.php I could delete the c2f cache file and the newly create file worked.
I'm attaching the two custome_fields_form.blade.php although the diffrences are the same as the cache files I think
custome_fields_form.blade.php.zip

If you can't recreate the issue, could you send me your 6.0.1 custome_fields_form.blade.php for me to test?
.

@snipe
Copy link
Owner

snipe commented May 18, 2022

https://github.com/snipe/snipe-it/blob/master/resources/views/models/custom_fields_form.blade.php

GitHub
A free open source IT asset/license management system - snipe-it/custom_fields_form.blade.php at master · snipe/snipe-it

@benseroussi
Copy link
Author

Thanks, the file is identical to the problematic one I have,
I also verified the file isn't being changed when restoring from backup, so it should happen on a fresh install when adding a textra custom field.
Can you reproduce?

@snipe
Copy link
Owner

snipe commented May 18, 2022

I cannot, and I can't reproduce it on the demo either (which runs the same code as is on master) - https://demo.snipeitapp.com/models (admin / password)

@benseroussi
Copy link
Author

benseroussi commented May 18, 2022

I cannot, and I can't reproduce it on the demo either (which runs the same code as is on master) - https://demo.snipeitapp.com/models (admin / password)

Snipe-IT Asset Management Demo

I just recrated it on the demo - same behaviour.
Steps:

  1. Create new custom field with element textra.
  2. Assign it to desktops and laptops
  3. Go to assest, create a new assest, pick model [OptiPlex (5040 (MRR81))] as it has those fields assigned.
  4. None of the custom field will show up.

I can see the demo is univerasl so you can just go straight to new assect and chose the first model I made called 1.

@snipe
Copy link
Owner

snipe commented May 18, 2022

Is this only happening with Textareas?

@benseroussi
Copy link
Author

Is this only happening with Textareas?

As far as I could run into.

I got the idea from uberbrady reply:

The differences, once I yank out whitespace, are pretty minor - just one about textareas and trying to do a 'graceful decrypt' in the newer version.

@snipe snipe changed the title Custom fields not showing up after updating to 6.0.1 Textarea custom field not showing in asset creation screen up after updating to 6.0.1 May 18, 2022
@snipe
Copy link
Owner

snipe commented May 18, 2022

Ah, I wish that had been clearer earlier on. I spent a lot of time debugging the wrong thing. :-/

@uberbrady / @inietov - can either of you take a look at this tomorrow.

The TLDR; is that textarea-type custom fields aren't showing up on asset creation even when they are in a field set that is associated with the selected model.

@benseroussi
Copy link
Author

Ah, I wish that had been clearer earlier on. I spent a lot of time debugging the wrong thing. :-/

@uberbrady / @inietov - can either of you take a look at this tomorrow.

The TLDR; is that textarea-type custom fields aren't showing up on asset creation even when they are in a field set that is associated with the selected model.

@benseroussi
Copy link
Author

benseroussi commented May 18, 2022

It's not only the textra, all the custom fields won't show up on a model that has at least one textarea custom field.

@snipe
Copy link
Owner

snipe commented May 18, 2022

Can you please try to make sure you actually say "textarea" when that's what you mean? I'm sure it was autocorrect messing it up and I'm sure it wasn't on purpose, but @uberbrady and I spent a lot of time trying to figure out what exactly you were talking about it, because textra isn't a word that makes sense here.

@benseroussi
Copy link
Author

Can you please try to make sure you actually say "textarea" when that's what you mean? I'm sure it was autocorrect messing it up and I'm sure it wasn't on purpose, but @uberbrady and I spent a lot of time trying to figure out what exactly you were talking about it, because textra isn't a word that makes sense here.

OH, so sorry, its not auto correct its my poor brain I meant textarea.

@snipe
Copy link
Owner

snipe commented May 18, 2022

I've just spent hours trying to figure out what a textra was 😂😩

@benseroussi
Copy link
Author

Again really sorry, at least I made up for it with this bug :X

@snipe
Copy link
Owner

snipe commented May 18, 2022

lol because we didn't have enough of those already :D

@snipe
Copy link
Owner

snipe commented May 18, 2022

Weirdly, I'm not seeing any huge differences between those files...

diff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.php
index 3cc053855..ca4f74b1b 100644
--- a/resources/views/models/custom_fields_form.blade.php
+++ b/resources/views/models/custom_fields_form.blade.php
@@ -9,11 +9,10 @@
               <!-- Listbox -->
               @if ($field->element=='listbox')
                    {{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
-                  Request::old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }}
+                  Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }}
 
               @elseif ($field->element=='textarea')
-                      <textarea class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}">{{ Request::old($field->db_column_name(),(isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))) }}</textarea>
-
+                      <textarea class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}">{{ Request::old($field->db_column_name(), Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}), (isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))) }}</textarea>
 
               @elseif ($field->element=='checkbox')
                     <!-- Checkboxes -->
@@ -47,15 +46,15 @@
 
                         <div class="input-group col-md-4" style="padding-left: 0px;">
                             <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd"  data-autoclose="true">
-                                <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="{{ $field->db_column_name() }}" id="{{ $field->db_column_name() }}" value="{{ old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}">
-                                <span class="input-group-addon"><i class="fa fa-calendar" aria-hidden="true"></i></span>
+                                <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="{{ $field->db_column_name() }}" id="{{ $field->db_column_name() }}" value="{{ old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}">
+                                <span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
                             </div>
                         </div>
 
 
                 @else
                     @if (($field->field_encrypted=='0') || (Gate::allows('admin')))
-                    <input type="text" value="{{ Request::old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text">
+                    <input type="text" value="{{ Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text">
                         @else
                             <input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>
                     @endif
@@ -71,14 +70,14 @@
           $errormessage=$errors->first($field->db_column_name());
           if ($errormessage) {
               $errormessage=preg_replace('/ snipeit /', '', $errormessage);
-              print('<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> '.$errormessage.'</span>');
+              print('<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> '.$errormessage.'</span>');
           }
             ?>
       </div>
 
         @if ($field->field_encrypted)
         <div class="col-md-1 col-sm-1 text-left">
-            <i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="{{ trans('admin/custom_fields/general.value_encrypted') }}"></i>
+            <i class="fas fa-lock" data-toggle="tooltip" data-placement="top" title="{{ trans('admin/custom_fields/general.value_encrypted') }}"></i>
         </div>
         @endif
 

It looks like mostly whitespace.

@snipe
Copy link
Owner

snipe commented May 18, 2022

The biggest thing I can see is that we fixed an issue where encrypted textareas would not be decrypted.

<textarea class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}">{{ Request::old($field->db_column_name(), Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}), (isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))) }}</textarea>

@snipe
Copy link
Owner

snipe commented May 18, 2022

Can you switch to the fixes/11120_textarea_on_fieldset branch and see if this resolves your issue?

snipe added a commit that referenced this issue May 18, 2022
Fixed #11120 - custom fields not showing when textarea is present as field type
@snipe snipe closed this as completed in ceffbb9 May 18, 2022
snipe added a commit that referenced this issue May 18, 2022
…field type

Signed-off-by: snipe <snipe@snipe.net>
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

4 participants