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

Unable to create new assets after update to Beta 4

Open rcarterv opened this issue 9 years ago • 4 comments

Expected Behavior (or desired behavior if a feature request)

Click the Create New -> Asset menu item, get prompted to enter information about the asset


Actual Behavior

I see a 'Whoops!' message


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 4.0 Beta 4
  • What OS and web server you're running Snipe-IT on Ubuntu 16.04, Apache
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Docker
  • WITH DEBUG TURNED ON, 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
  • If a stacktrace is provided in the error, include that too.

When I Try to create an asset:

[2017-09-06 10:45:14] production.ERROR: ErrorException: Undefined property: App\
Models\Asset::$name in /var/www/html/app/Models/SnipeModel.php:87

Next ErrorException: Undefined property: App\Models\Asset::$name (View: /var/www/html/resources/views/partials/forms/edit/name.blade.php) in /var/www/html/app/Models/SnipeModel.php:87

Next ErrorException: Undefined property: App\Models\Asset::$name (View: /var/www/html/resources/views/partials/forms/edit/name.blade.php) (View: /var/www/html/resources/views/partials/forms/edit/name.blade.php) in /var/www/html/app/Models/SnipeModel.php:87

When I try to create a license:

[2017-09-06 12:16:04] production.ERROR: ErrorException: Undefined property: App\
Models\License::$name in /var/www/html/app/Models/SnipeModel.php:87


Next ErrorException: Undefined property: App\Models\License::$name (View: /var/w
ww/html/resources/views/partials/forms/edit/name.blade.php) in /var/www/html/app
/Models/SnipeModel.php:87



Next ErrorException: Undefined property: App\Models\License::$name (View: /var/w
ww/html/resources/views/partials/forms/edit/name.blade.php) (View: /var/www/html
/resources/views/partials/forms/edit/name.blade.php) in /var/www/html/app/Models
/SnipeModel.php:87
  • Any errors that appear in your browser's error console. None
  • 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. See above
  • Include what you've done so far in the installation, and if you got any error messages along the way. No errors during install
  • Indicate whether or not you've manually edited any data directly in the database No manual edits

============================

So, I was able to work-around the problem by:

  • Edit /var/www/html/resources/views/partials/forms/edit/name.blade.php
  • Change line 5 from: ... Input::old('name', $item->name)... -to- ... Input::old('name', '')...
  • retry the asset creation (now it works)

rcarterv avatar Sep 06 '17 18:09 rcarterv

That won't work when you're editing an asset though. It will drop the existing name.

snipe avatar Sep 06 '17 20:09 snipe

Good to know! I am in 'add assets' mode at the moment. Open to better work arounds :)

rcarterv avatar Sep 06 '17 21:09 rcarterv

@rcarterv we'll be fixing this shortly. I think it's related to changes in a recent PR from @dmeltzer

snipe avatar Sep 06 '17 21:09 snipe

Can you do a fresh pull from develop and tell me if that worked?

snipe avatar Sep 06 '17 23:09 snipe