< 172026-06-18⋎19 >

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
00:09*mstenta[m] has quit (Ping timeout: 480 seconds)
00:09*RobertDuncan[m] has quit (Ping timeout: 480 seconds)
00:15*mstenta[m] has joined
00:18*RobertDuncan[m] has joined
12:28*tool172[m] has joined
12:28tool172[m]Is the Farm_bundle hooks with fields the same way to add to activity logs with the push hook for the old data on custom fields added to logs?
12:28tool172[m]basically per the page notes
12:53mstenta[m]Hi tool172 - just responded to your forum topic... :-)
12:53mstenta[m]farmos.discourse.group/t/proper-way-to-a
12:54tool172[m]i used the original way of declaring the field.field.log.activity.field_breeding_sire.yml
12:54mstenta[m]Oh ok, so not via the hooks described on farmos.org/development/module/ ?
12:55tool172[m]correct
12:55mstenta[m]Is this already deployed to a live databsae?
12:55tool172[m]the fields are there and verified
12:55mstenta[m]If not, I would recommend doing it the way described in farmos.org/development/module/ instead
12:55tool172[m]okay
12:56mstenta[m]There are two ways to define fields in Drupal... via config (like you did in the YML file) or via code.
12:56tool172[m]I did it via yml
12:56tool172[m]the display in the core on the hook is the problem
12:56tool172[m]the data is fine
12:57mstenta[m]farmOS has a bunch of special logic to automatically add expose fields in various places (lists of logs, csv importers, on the log view/edit pages, etc). But that only works if the fields are defined in code.
12:57tool172[m]which is through the field farm factory
12:58tool172[m]Basically I realized I can make a breeding module by adding two unrequired fields to activity logs and basically track everything through birth
12:58mstenta[m]Field farm factory is used to create fields in code (via the hooks documented in farmos.org/development/module/)
12:59mstenta[m]OK, you mentioned adding fields to an activity log... maybe you actually want to add fields to a birth log?
12:59tool172[m]nope
12:59tool172[m]I'm tracking gestation
12:59mstenta[m]OK
12:59tool172[m]I just want to add the bull, and the date
12:59tool172[m]the rest can be calculated automatically in a view
12:59tool172[m]then the view can point to the birth log
12:59mstenta[m]Maybe you want a new log type for insemination?
13:00tool172[m]drop down in the activity log for sire and one for type
13:00tool172[m]both activity logs to parent asset with breeding category
13:00mstenta[m]If you add those to activity logs, then they will appear on ALL activity logs... even ones that might have nothing to do with breeding
13:00tool172[m]saves all the headaches and keeps it tied to time/date and animal asset
13:00mstenta[m]That's why maybe a new log type is warranted
13:00tool172[m]but there not required fields so can be blank though
13:01mstenta[m]True. Just a suggestion. You can do it if you want. :-)
13:01tool172[m]I've gone back and forth with that in my head and read through the last 6 years or so of notes in the forums
13:01tool172[m]it would be easier with a new log type though
13:01mstenta[m]This is a good example where a new log type does make sense.
13:02tool172[m]i can drush clear it out and do that. It would be easier to make that contrib module :)
13:02mstenta[m]Curious how botlfarm handles this...
13:02mstenta[m]And others who breed
13:02tool172[m]I'm thnking too make a setup page in the module, then link species to asset to list and you could calculate some of the gestations automatically for a variety of animals
13:03tool172[m]I'm just cow/calf and small so i don't care
13:03mstenta[m]This describes how to add a log type: farmos.org/development/module/entities/
13:03tool172[m]I'll keep working slowly
13:03mstenta[m]That also includes how to add a bundle field to the new log type
13:03mstenta[m]All in the same file
13:04tool172[m]I switched to cattlemax and they can't give me reports on grazing durations so I'm just starting to code it now
13:04tool172[m]can you add an option for dashed lines on mapbox as an option dropdown? I know it's in the api
13:04tool172[m]or where do you want the implementation request dropped. Github?
13:04mstenta[m]in what context?
13:04mstenta[m]"change ALL lines to dashed lines"?
13:05mstenta[m]or only in certain places/contexts?
13:05tool172[m]when creating a field
13:05tool172[m]choose dashed or solid and color
13:05mstenta[m]so only in the drawing tool context?
13:05tool172[m]yes so when you view it , it can be unique
13:05mstenta[m]or do you mean storing that choice somewhere as well?
13:05tool172[m]yes for rendering
13:05mstenta[m]geometries are not stored with any information about rendering
13:05mstenta[m]only the point/line/polygon information is saved
13:06tool172[m]so it would be a new field then since the api calls a wrapper i think.
13:06tool172[m]i looked at it last week
13:07tool172[m] // 2. Add the line layer with the dash pattern... (full message at <matrix.org/oftc/media/v1/media/download/>)
13:07tool172[m]its an added layer.. don't know how hard that would be to add, but it would allow color with a drodown and dashed or not i suppose
13:08tool172[m]i would use something like that for overlays as I run poly cross fences and expand and contract as our summers dry up
13:08tool172[m]i just make new pastures with sub IDs. Like South 8, South 8.1, South 8.2, South 8.3 etc
13:10mstenta[m]Yea it's very easy to set the line style in OpenLayers... the problem is that farmOS doesn't have any way of knowing which geometries should be solid and which should be dashed
13:10tool172[m]I had another question too for the Grazing Plan module. Do I have to have the plan setup to just build a report on the movements? I care more about average report of Days of rest and days grazed than the rest of info. The goal is to stay out of the parasite lifecycle and the days grazed and rest periods show if I'm building forage
13:10mstenta[m]If you wanted to be able to select that when you were drawing, we would need some place to store that decision in the database
13:10mstenta[m]And then we could render it appropriately
13:11mstenta[m]But storing that would probably be tricky...
13:11mstenta[m]We use this module for geometry storage: www.drupal.org/project/geofield
13:11mstenta[m]That doesn't include any style information in its database storage... just geometry
13:12tool172[m]just food for thought, I know people have been looking
13:12mstenta[m]Question: instead of storing solid/dashed for every geometry... what if we rendered dashed lines just in certain contexts...
13:12tool172[m]That's kind of where I was thinking Like field vs paddock or use a flag that renders it
13:12mstenta[m]Maybe if we talk through your use-case a bit more, and why you want dashed lines, we could figure out a more general rule that could be applied automatically without needing to store the decision on a per-geometry basis
13:13mstenta[m]Feels like a good forum topic :-)
13:13tool172[m]I'm deep in making cattle module come to reality
13:13mstenta[m]tool172[m]: The Grazing Plan module is still "alpha" but you might find it useful, and it would be great to have more people testing and providing feedback!
13:14tool172[m]I'm testing it :)
13:15mstenta[m]The main thing it provides is a) data model (a grazing plan type with a grazing_event plan record that link to a movement log and stores: planned start date, days of grazing, and days of recovery), and b) a timeline visualization of the grazing events
13:16mstenta[m]So it just adds a bit more data model on top of the existing farmOS movement logs data model... specifically for keeping track of grazing days and recovery days (since that is not explicitly stored anywhere else in movement logs)
13:16tool172[m]that's the part I have a hangup with. I want to just move the assets there
13:16tool172[m]and it to update when I move em out
13:16tool172[m]then build the chart as the data comes in
13:16tool172[m]our plans our trashed already out here. we've had 37 inches of rain and where not into july yet
13:17mstenta[m]so you just want to be able to use it for reporting afterwards, not necessarily for planning ahead... am i understanding correctly?
13:17mstenta[m]it would work great for that!
13:17tool172[m]yea
13:17tool172[m]and a report
13:17tool172[m]with a list of fields/paddocks
13:17mstenta[m]you would just need to add the movement logs to it afterwards, and fill in the grazing days and recovery days
13:18tool172[m]why can't that be filled in if not null
13:18tool172[m]recovery is last used in time - moved back in
13:18mstenta[m]not sure i understand... can you describe more, or paste a screenshot?
13:19tool172[m]so if i made a table of pasture movement logs
13:19mstenta[m]grazing days is required for the visualization, recovery time is optional
13:19mstenta[m](if i remember correctly)
13:19tool172[m]grazing days change based of forage. so If i pre put in 3 and it's 2.5 or 2 will it update?
13:20tool172[m]I'll draw it up in the forum once I get some time and traction. probably another 6 months. I want to get breeding reports and tracking finished -> then pastures.
13:20mstenta[m]let me try explaining the workflow i'm suggesting in a little more detail, then you can tell me if that fits, or why not...
13:21mstenta[m]at the beginning of the season, create a plan called "2026 Grazing Plan"
13:22mstenta[m]then move your animals to a paddock (in real life), and in farmOS use the grazing plan module w/ the movement quick form to record that as a movement, with anticipated grazing days and (optionally) recovery time. then, when you move them again, do the same thing... but you may have to manually adjust the previous grazing days/recovery based on what you experience in the real world
13:23mstenta[m]that last bit ("you may have to manually adjust the previous grazing days") could be a good feature request for automating that
13:23tool172[m]I saw that, I made a 2026 grazing plan
13:24tool172[m]I was just wondering if that report could be populated by the group movement logs between pastures/fields/paddocks
13:24tool172[m]it would be a report view i suppose. I see now why you did it that way
13:24tool172[m]it's faster to render the data
13:25mstenta[m]if you just want to generate reports after grazing, you don't necessarily need the grazing plan module... you could just look at the movements in the databasa and calculate the actual grazing days
13:25mstenta[m]you wouldn't have recovery time, of course... unless you were also tracking that with logs somehow
13:25mstenta[m]yea, another reason to use the grazing plan is to capture the "planned" vs the "actual"
13:25tool172[m]recovery time is the difference between movement into the same pasture
13:25mstenta[m]the grazing events record the "planned" grazing days and recovery time
13:26mstenta[m]but the logs capture the "actual"
13:26mstenta[m]tool172[m]: ideally
13:26mstenta[m]but it could be less too
13:26mstenta[m]eg: grass could recover before you move animals into it again
13:26tool172[m]valid.
13:27mstenta[m]eg: grass recovers in 15 days but animals aren't moved in until 30 have passed
13:27mstenta[m]that would be valuable information to have for future planning...
13:27tool172[m]ideally. rain changes that :)
13:27tool172[m]we get almost 40 inches by july, then we get like nothing until mid sept
13:28mstenta[m]yea... that's why we leave it up to you to fill in the "anticipated" recovery time in the module... veeeeery complicated to try to predict that 😆
13:29tool172[m]good talk , I'm going to go continue cleaning up some storm damage
13:29tool172[m]i'll build a new breeding log then. I'll post my repo at some point
13:36mstenta[m]great! good luck with the cleanup! hope it wasn't too bad!
13:36mstenta[m]thanks for the good ideas and discussion
13:46symbioquine[m]According to my weather station, we're at just under 13 inches of rain for the year so far here and about 40 for the trailing 12 months.
15:57symbioquine[m]The farmOS weekly dev call starts in 3 minutes. All are welcome! meet.jit.si/farmos-dev
17:18mstenta[m]symbioquine: OK so we were wrong on the dev call... the test logic *is* correct. :-(
17:19mstenta[m]So back to square one.
17:19mstenta[m]The line that we thought was wrong is correct: github.com/farmOS/farmOS/blob/0707897881
17:19mstenta[m]That's doing two things...
17:20mstenta[m]1. `$image_style->buildUrl($test_uri)` takes the `original` file and generates a URL to the *derivative*
17:20mstenta[m]That returns an absolute URL (with www/ prepended)
17:20mstenta[m]So...
17:21mstenta[m]2. We pass it into `\Drupal::service('file_url_generator')->transformRelative(...)` to make it relative.
17:21mstenta[m]We missed part 1 on the call, I think/.
17:22mstenta[m]$image_style is initialized earlier in the test, specifically for the large image style: github.com/farmOS/farmOS/blob/0707897881
17:22mstenta[m]So then we're basically just using a helper method on that object to generate the URL that should be used to request the derivative file.
17:23mstenta[m](which also includes an ?itok=... GET param)
17:23mstenta[m]For example: /sites/simpletest/78716630/files/styles/large/public/rotate90cw.jpg.webp?itok=AWPMHfvj
17:24mstenta[m]So that's all correct usage, and works fine locally... still not sure why it started failing in GitHub Actions :-(
17:25mstenta[m]We were misinterpreting it on the call
17:27mstenta[m]I also found the Drupal core test that I modeled this off of... it has the same logic
17:29mstenta[m]git.drupalcode.org/project/drupal/-/blob
17:29mstenta[m]<mstenta[m]> "So back to square one." <- `¯\_(ツ)_/¯` 😭
17:36mstenta[m]I'll run that core test and see if it passes in GitHub...
17:48mstenta[m]Ah worth noting: I just updated farmOS v3 to the new Drupal core release, and tests passed there! (including this test)
17:49mstenta[m]Tagging 3.5.4 now...
17:49mstenta[m]This is all seeming to point to some dependency differences...
17:50mstenta[m]Diffing composer.lock is next on my list of things to test
17:55mstenta[m]<mstenta[m]> "I'll run that core test and..." <- This test passed!!!
17:56mstenta[m]😵‍💫
17:56mstenta[m]So it must not be a file permissions issue...
17:56mstenta[m]Well I guess I have a new pathway to explore at least 😅
17:57mstenta[m]Might still be a dependency change... but must be specific to our test somehow
18:13symbioquine[m]<mstenta[m]> "Might still be a dependency..." <- Yeah, maybe webp related?
19:18mstenta[m]Alright I think I have a fix...
19:19mstenta[m]tl;dr: our tests were using the existing large image style, which we add our image orientation effect to... and the test was testing both a) that the effect was added to large, and b) that orientation works with large
19:19mstenta[m]I'm separating the tests... so that the actual image effect testing is done with a new image style (not large) - and that seems to work
19:19mstenta[m]I still don't know what changed with large for it to stop working (and it works locally)...
19:20mstenta[m]But I'm going to commit this as a general test improvement and then put out 4.0.3 with the security updates
19:20mstenta[m]Then, if we find any issues with the actual styles (eg: large) we can follow up
19:31symbioquine[m]Weird 🤔
19:31symbioquine[m]glad you found a workaround
21:11farmBOT@farmOS@fosstodon.org => #farmOS 3.5.4 has been released! github.com/farmOS/farmOS/releases/3.5.4 => fosstodon.org/@farmOS/116772572816309676

< 172026-06-18⋏19 >