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