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

Error when creating asset - 'Purchase cost' cannot be null #2515

Closed
2 tasks done
veen1981 opened this issue Aug 29, 2016 · 12 comments
Closed
2 tasks done

Error when creating asset - 'Purchase cost' cannot be null #2515

veen1981 opened this issue Aug 29, 2016 · 12 comments
Labels
✋ bug Confirmed bug
Milestone

Comments

@veen1981
Copy link

Expected Behavior (or desired behavior if a feature request)

When creating a new asset, the purchase cost should be marked as either required, or not required. Attempting to save the asset should produce a warning message if required fields are not filled out.


Actual Behavior

Not sure if this is intended, but somewhere in the last week or two, whenever creating an asset without a purchase cost, the page will refresh to a blank Create Asset page without generating any error message in the browser. If I put a purchase cost of 0.00 in, or whatever, the asset will create successfully. Previously, the purchase cost field could be left blank. I have included the logs below:

purchasecost.txt


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.3.0-16-ge52a0f6
  • What OS and web server you're running Snipe-IT on Centos7 / Apache/ PHP 7.0.9
  • 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 no errors in browser, the only errors are found in the logs
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error https://our.site.edu/hardware/create I will fill in Asset Tag, Model, Serial, Asset Name, Status, User, Company Asset Name, Default Location and Supplier, I leave the rest blank and click save and the page just clears and refreshes with no error message
  • If a stacktrace is provided in the error, include that too. Attached
  • Any errors that appear in your browser's error console. No errors in browser
  • 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. Attached
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database No
@snipe
Copy link
Owner

snipe commented Aug 29, 2016

Can you reproduce this on the demo? I can't seem to, nor can I reproduce it locally.

@veen1981
Copy link
Author

No I can't... not sure where this is coming from all the sudden. It isn't a huge deal, we can use the workaround of entering $0.00 for assets where the purchase cost is unknown.

@snipe
Copy link
Owner

snipe commented Aug 30, 2016

Still very weird that you'd be seeing one thing and the demo would be doing something else.

Also I didn't see a stack trace attached - can you paste it in here?

@snipe
Copy link
Owner

snipe commented Aug 30, 2016

Or was that the purchase cost.txt?

@snipe
Copy link
Owner

snipe commented Aug 30, 2016

Are you running in strict mode?

@veen1981
Copy link
Author

Should be in the purchasecost.txt

@snipe
Copy link
Owner

snipe commented Aug 30, 2016

Try running:

ALTER TABLE assets MODIFY purchase_cost DECIMAL(13,4) null;

@veen1981
Copy link
Author

ERROR 1054 (42S22): Unknown column 'mycolumn' in 'assets'

How do I check if strict-mode is enabled?

@snipe
Copy link
Owner

snipe commented Aug 30, 2016

Please see the edited SQL above

@veen1981
Copy link
Author

The ALTER TABLE? The error 1054 is what was returned.

@snipe
Copy link
Owner

snipe commented Aug 30, 2016

As above: ALTER TABLE assets MODIFY purchase_cost DECIMAL(13,4) null;

@veen1981
Copy link
Author

As usual, you're a genius! I apologize for being a little slow this morning. Our fall semester just started and my brain is slightly fried. I was able to create and asset without a purchase cost successfully! Thank you!

@snipe snipe added the ✋ bug Confirmed bug label Aug 31, 2016
@snipe snipe modified the milestone: v3.4.0 Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✋ bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants