-
-
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
Textarea custom field not showing in asset creation screen up after updating to 6.0.1 #11120
Comments
👋 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. |
I'm not able to reproduce this locally. Investigating further on our end, but in the meantime, have you tried running:
? |
I run:
As per the migrate guide. Thanks for the quick reply. |
I can't reproduce this on the demo either... https://demo.snipeitapp.com/hardware/create (MacBook Pro 13" has a fieldset associated with it) |
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. |
Could you be more specific? We've updated many of our hosted users without any issues. |
I just finished installing the server about 2 hours ago. before restoring my 5.4.4 backup I made a backup. its from vendor/symfony/console/Helper/QuestionHelper.php:113 Thats an improvment, when I tried restoring from the GUI before all I got was error 500. PS. |
How were you trying to restore? Via cli or web UI? |
Also is there any more to that stack trace? |
Via web UI I get this error. 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? |
Yes, it was too long to post, what to do with it? |
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: 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 |
The 2nd seems to have a lot of company info so just me know if it's needed. |
Does the restore fail when you run it via cli as well? |
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. |
It actually uses the |
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. |
I know, and it work diffrently with linux and windows. 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! |
Of course it does, that's why we document the ways to find out the different paths. 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. :-/
|
The backup on windows works, the restore doesn't. Did you manage to take a look on the php files and figure out what caused my issue? |
I am working on something else at the moment. |
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 Then try this:
In the output, look for those column names in your database in the Assets table - are they there? |
Then try running this (also in tinker) -
Do the names match up? |
I don't know how to check for it in the data base, the output was all my custom fields: |
Those are cached files - you don't want to carry them over as they get overwritten over time. |
This is with the old php(the working one): Same with both phps |
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. |
Caches files are never included in the generated backup, since the system generates them as needed. |
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. |
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 If you can't recreate the issue, could you send me your 6.0.1 custome_fields_form.blade.php for me to test? |
https://github.com/snipe/snipe-it/blob/master/resources/views/models/custom_fields_form.blade.php
|
Thanks, the file is identical to the problematic one I have, |
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 ( |
I just recrated it on the demo - same behaviour.
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. |
Is this only happening with Textareas? |
As far as I could run into. I got the idea from uberbrady reply:
|
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. |
|
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. |
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. |
I've just spent hours trying to figure out what a textra was 😂😩 |
Again really sorry, at least I made up for it with this bug :X |
lol because we didn't have enough of those already :D |
Weirdly, I'm not seeing any huge differences between those files...
It looks like mostly whitespace. |
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> |
Can you switch to the |
Fixed #11120 - custom fields not showing when textarea is present as field type
…field type Signed-off-by: snipe <snipe@snipe.net>
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
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
Additional context
No response
The text was updated successfully, but these errors were encountered: