< 262024-03-27⋎28 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
11:10mstenta[m]fosten: Thinking about the `is_movement`, `is_fixed`, and `is_location` boolean columns we are considering adding to CSV importers... these are the first boolean columns we're adding, which reminds me why I didn't add any boolean support originally: we need to decide how they should work. What values should they accept? Y/N? Yes/No? True/False? All of the above? Case insensitive? Unfortunately I don't think Drupal's core Migrate API module
11:10mstenta[m]nor the contrib Migrate Plus provide any process plugins that handle all of this automatically for us. So we either need to use the `static_map` plugin, and list out ALL the potential options and what they map to (`0` or `1`) on EVERY mapping, or we need to create a custom plugin that can be reused on each mapping.
11:10mstenta[m]Not too hard... but that's the main work involved I think.
11:10mstenta[m]Oh and adding automated tests...
11:11mstenta[m]I have the first step sketched up so maybe I'll open a draft PR for this discussion and leave this comment there... better to have it in a PR than in this chat I suppose :_)
12:19mstenta[m]Oh cool I found a potential solution: $bool = filter_var($value, FILTER_VALIDATE_BOOLEAN); (see stackoverflow.com/a/10645030)
12:22mstenta[m]Oh the other challenge with these booleans is: we need them to default to NULL if no value is provided, so that it can be set based on the asset/log type. Because for example is_location defaults to TRUE for land assets but FALSE for animal assets.
12:22mstenta[m]It may make sense to provide our own plugin to encapsulate all this logic in a reusable way.
13:42mstenta[m]fosten: github.com/farmOS/farmOS/pull/815
13:42mstenta[m]Still some todos... but wanted to get the draft up at least
18:11symbioquine[m]Trying to think of animals that make sense with fixed locations... Barnacles, Coral, Bee hives (in something like a tree trunk)
18:15symbioquine[m]I feel like there's some obvious ones I'm missing...
18:15symbioquine[m](Not sure there's much overlap with things that are typically farmed.)
18:17symbioquine[m]The other risk is that folks could get confused about the difference between the is_fixed and is_castrated fields on animals.
18:17mstenta[m]ooh yea
18:18symbioquine[m]Especially in the context of a CSV template where there isn't an explanation.
18:20symbioquine[m]On the whole though, it probably just makes sense to keep things simple and have the is_fixed/intrinsic_geometry fields work the same for all asset types.
20:53*spacespy[m] has quit (Quit: Client limit exceeded: 20000)

< 262024-03-27⋏28 >