snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Custom field format changed to regex:/^ANY$/ after 3.0 update

Open korio77 opened this issue 10 years ago • 9 comments

Expected Behavior (or desired behavior if a feature request)

(what you expect to happen goes here)


Actual Behavior

All the custom field formats created before the update with the value "ANY" are changed to regex:/^ANY$/ and now when we try to create assets with those custom fields it fails and says the format is incorrect.

Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running v3.0-ebc74a65
  • What OS and web server you're running Snipe-IT on Windows Server 2012 with IIS 8
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Manual
  • If you're getting an error in your browser, include that error.
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error At this page /hardware/create when saving a new asset
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console. Just one error on one font load, dont think its related.
  • Confirm whether the error is reproduceable on the demo.
  • Include any additional information you can find in app/storage/logs and your webserver's logs. No error found on logs
  • Include what you've done so far in the installation, and if you got any error messages along the way. No errors during update
  • Indicate whether or not you've manually edited any data directly in the database. Nothing edited.

This image is the error at trying to save a new asset. image

The next image is from custom fields, the last one created in v3.0 the other ones created on v2.1 image

korio77 avatar Jul 21 '16 10:07 korio77

Thanks for the excellent bug report!

It looks like I must have missed it in the migration here:

https://github.com/snipe/snipe-it/blob/master/database/migrations/2016_03_22_125911_fix_custom_fields_regexes.php

uberbrady avatar Jul 22 '16 04:07 uberbrady

Im glad it could help!

So now, how can i fix it, because right now we cant add new assets and we are migrating our old "asset control" stuff to Snipe IT.

Its anything i can do to fix it right now? like changing any database value or something like that?

Keep the good work, the tool is gorgeous!

korio77 avatar Jul 22 '16 06:07 korio77

Do you have access to the database directly? If you do, change the value of the weird regex ones to blank, and see if that helps. I'm working on fixing the issue now.

snipe avatar Jul 22 '16 07:07 snipe

Also can you tell me if you did any migration rollbacks? I can reproduce this locally, but I rollback migrations constantly, so not sure if this would affect anyone who hasn't rolled back.

snipe avatar Jul 22 '16 08:07 snipe

I have a fix out on the dev branch now - the migration I created should clean up the donked field values.

snipe avatar Jul 22 '16 08:07 snipe

Sorry for the late answer, im at work right now and have little time to check this.

I didnt do any rollbacks.

Thanks for the fix!

korio77 avatar Jul 22 '16 10:07 korio77

You should try it before you thank me :P

snipe avatar Jul 22 '16 11:07 snipe

So what should i do to apply the updates. Download from here the newest files, aply them to my server and do a "composer update" or something like that? I usually wait for new full downloads from your web.

korio77 avatar Jul 26 '16 08:07 korio77

run php artisan migrate, same as you would any time you upgrade.

snipe avatar Jul 26 '16 09:07 snipe