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 in filling animal birthdate #687

Closed
Lok17 opened this issue Jun 17, 2023 · 2 comments
Closed

Error in filling animal birthdate #687

Lok17 opened this issue Jun 17, 2023 · 2 comments
Labels

Comments

@Lok17
Copy link

Lok17 commented Jun 17, 2023

Describe the bug
A farm animal usually cannot live longer than 20 years. The system should report error as farm animal usually cannot live for more than 20 years.

To Reproduce
Steps to reproduce the behavior:

  1. Click the “Animal” asset tab.
  2. Click the “Add Animal Asset” button.
  3. Click name field and input “Chicken”.
  4. Click species/breed field and input “Red
    junglefowl”.
  5. Click birthdate field and input animal birthdate
    “01/01/1950 12:00:00”.
  6. Others field remain as default
  7. Click the “Save” button.

Expected behavior
System should report error as farm animal usually cannot live for more than 20 years.

Screenshots
image
image
image

Desktop (please complete the following information):

  • OS: 64-bit Windows 7, Windows 8.1, Windows 10, Windows 11
  • Browser: chrome
  • Version: 2.0.4

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@Lok17 Lok17 added the bug label Jun 17, 2023
@wotnak
Copy link
Collaborator

wotnak commented Jun 17, 2023

I wouldn't consider this a bug. For example, horses or donkeys can easily live more than 20 years. Someone might also want to input into farmOS historical records that were earlier recorded on paper to have complete information of the current animals' lineage.

farmOS is intentionally designed to by default not limit the ways someone can use it. That said, limiting birthdates possible to input can for sure be useful for some operations to reduce accidental errors, but I would argue that such feature should be implemented as a contrib/custom module instead of as part of the farmOS core since the specific validation constraints can vary between farms depending on what/how animals are managed on them.
I've created an example implementation of such validation as a custom module https://github.com/wotnak/farm_animal_birthdate_limit. You can install and try it out on your farmOS instance, or use it as a base to implement some more custom form validation.

@mstenta
Copy link
Member

mstenta commented Jun 17, 2023

Thanks for opening this issue @Lok17 but I agree with @wotnak farmOS needs to allow entering historical records. If you were entering animal records that you recorded on paper 20 years ago for archival/organizational purposes, the animal's birthday would need to accommodate that.

@mstenta mstenta closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants