IRC logs for #farmOS, 2021-03-26 (GMT)

2021-03-25
2021-03-27
TimeNickMessage
[00:43:16]* farmBOT has joined #farmos
[12:06:51]<symbioquine[m]>ACTION < https://matrix.org/_matrix/media/r0/download/matrix.org/orDAnxYrFzuEpNGF... >
[12:07:43]<symbioquine[m]>ACTION uploaded an image: (33KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/rgEZZZeuvfPCvkSv... >
[12:08:43]<symbioquine[m]>I have the equivalent of [this code](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...) in my view too...
[12:13:55]<paul121[m]>huh.. seems like you've got it integrated with `hook_farm_ui_entity_views` just fine
[12:14:15]<paul121[m]>my guess is an issue with the contextual filter
[12:14:45]<paul121[m]>can change the "display no results behavior" to show something?
[12:15:09]<paul121[m]>and/or for the contextual filter, if it doesn't exist or validate, make sure it still renders something?
[12:15:11]<symbioquine[m]>Yeah, I tried that, but still nothing is showing up under the header.
[12:15:22]<symbioquine[m]>It's like the view isn't even trying to render actually...
[12:15:49]<paul121[m]>right.. weird!
[12:16:20]<paul121[m]>and you can preview the view OK? by manually filling the contextual filter?
[12:18:15]<symbioquine[m]>Well, I don't have much experience with these contextual views so I wasn't sure what input to put there...
[12:18:24]<symbioquine[m]>some sort of query string?
[12:19:04]<paul121[m]>ah. yea, try just putting in an asset id
[12:19:22]<symbioquine[m]>as just the bare number?
[12:19:29]<paul121[m]>yes
[12:19:39]<symbioquine[m]>interesting
[12:19:46]<paul121[m]>if that doesn't work you might need to put in `asset/{id}`
[12:20:10]<paul121[m]>your contextual filter should probably be configured to grab the second path argument from the URL
[12:20:58]<paul121[m]>(wait... maybe the third. is the path `/farm/asest/{id}` ?) My brain is stuck in D9)
[12:21:39]<paul121[m]>oh... you're putting this on a term page!
[12:21:41]<symbioquine[m]>I'm testing this part first on the `farm_plantings` view
[12:22:01]<symbioquine[m]>Just to make sure I understand how to test it with a working view
[12:23:10]<symbioquine[m]>It does render when I set the path to `/farm/asset/2569` (a valid planting id), but it didn't seem to affect the results - which probably makes sense since there isn't a contextual filter for planting on the plantings view.
[12:23:45]<paul121[m]>right
[12:24:17]<paul121[m]>for your `farm_seeds` view I think the contextual filter would be `/farm/crop/{crop_name}`
[12:25:31]<paul121[m]>with a contextual filter that validates the taxonomy term name
[12:26:37]<symbioquine[m]>Just focusing on the `farm_plantings` view though (which we know works) - if I put in `/farm/crop/Wheat-Kyle` it doesn't appear to affect the results in the view preview.
[12:27:41]<symbioquine[m]>ACTION uploaded an image: (86KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/XzxONXrtjYmcNRIX... >
[12:28:06]<symbioquine[m]>This is at `/admin/structure/views/view/farm_plantings/edit`
[12:28:34]<paul121[m]>maybe it does need the taxonomy term ID ?
[12:28:36]<symbioquine[m]>I also tried `/taxonomy/term/404`
[12:34:34]<paul121[m]>hmm
[12:35:26]<symbioquine[m]>I think I might need to trace through [this code](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...) next...
[12:35:44]<symbioquine[m]>Might be somehow it's not finding my view or passing the args as expected.
[12:39:02]<paul121[m]>yeah
[12:39:19]<paul121[m]>I'm trying to find where `farm_plantings` is added to the term page?
[12:39:21]<paul121[m]>did you find that?
[12:39:38]<symbioquine[m]>yeah
[12:40:44]<symbioquine[m]>oh, wait
[12:40:52]<symbioquine[m]>No, I'm not sure about that
[12:41:23]<paul121[m]>I think the `farm_crops` view might be used there..
[12:41:48]<symbioquine[m]>I was using these examples; [1](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...), [2](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...)
[12:41:55]<symbioquine[m]>but maybe they're not representative.
[12:42:04]<paul121[m]>[here](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...)
[12:42:53]<symbioquine[m]>But that only has an effect if vocabulary_machine_name == `farm_crop_families`
[12:43:20]<symbioquine[m]>So, I think that's supposed to add the list of `farm_crops` to the `farm_crop_families` taxonomy page.
[12:43:29]<paul121[m]>ah ah yes. you're right
[12:44:20]<symbioquine[m]>Could it be this: https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4... ?
[12:46:29]<paul121[m]>think so!
[12:48:03]<paul121[m]>well, only kinda
[12:48:55]<paul121[m]>I think specifying `farm_asset` must tell it to use the view configured for `planting` asset
[12:49:46]<paul121[m]> * I think specifying `farm_asset` must tell it to use the view configured for `planting` asset defined [here](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...)
[12:50:08]<paul121[m]> * I think specifying `farm_asset = planting` must tell it to use the view configured for `planting` asset defined [here](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...)
[12:51:17]<paul121[m]>based on the docs [here](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...)
[12:57:46]<paul121[m]>You could also implement `hook_entity_view` and render the view yourself: https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...
[13:03:49]<symbioquine[m]>Cool, I'll play around with those this evening... Thanks for looking into it!
[14:14:00]* twiclo has quit (Ping timeout: 258 seconds)