IRC logs for #farmOS, 2024-03-27 (GMT)

2024-03-26
2024-03-28
TimeNickMessage
[07:10:06]<mstenta[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
[07:10:06]<mstenta[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.
[07:10:27]<mstenta[m]>Not too hard... but that's the main work involved I think.
[07:10:34]<mstenta[m]>Oh and adding automated tests...
[07:11:16]<mstenta[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 :_)
[08:19:01]<mstenta[m]>Oh cool I found a potential solution: $bool = filter_var($value, FILTER_VALIDATE_BOOLEAN);  (see https://stackoverflow.com/a/10645030)
[08:22:11]<mstenta[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.
[08:22:53]<mstenta[m]>It may make sense to provide our own plugin to encapsulate all this logic in a reusable way.
[09:42:10]<mstenta[m]>fosten: https://github.com/farmOS/farmOS/pull/815
[09:42:22]<mstenta[m]>Still some todos... but wanted to get the draft up at least
[14:11:43]<symbioquine[m]>Trying to think of animals that make sense with fixed locations... Barnacles, Coral, Bee hives (in something like a tree trunk)
[14:15:09]<symbioquine[m]>I feel like there's some obvious ones I'm missing...
[14:15:56]<symbioquine[m]>(Not sure there's much overlap with things that are typically farmed.)
[14:17:30]<symbioquine[m]>The other risk is that folks could get confused about the difference between the is_fixed and is_castrated fields on animals.
[14:17:55]<mstenta[m]>ooh yea
[14:18:13]<symbioquine[m]>Especially in the context of a CSV template where there isn't an explanation.
[14:20:46]<symbioquine[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.
[16:53:09]* spacespy[m] has quit (Quit: Client limit exceeded: 20000)