IRC logs for #farmOS, 2022-04-01 (GMT)

2022-03-31
2022-04-02
TimeNickMessage
[02:59:17]* farmBOT has joined #farmos
[12:00:08]<paul121[m]>TIL that Drupal provides a JS function for building URL paths. We should use this!... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/ca66b6f52e...)
[12:00:27]<mstenta[m]>Oh!
[12:00:35]<paul121[m]>There are a few spots we build a url and I don't think we use the `drupalSettings.path.pathPrefix`
[12:01:55]<mstenta[m]>True! Historically we've had a few bugs related to install farmOS in a sub directory, generally related to this
[12:02:18]<paul121[m]>Also came across this cool site - documentation for the Drupal JS functions/behaviors: https://drupaljs.net/Drupal.html#.url
[12:02:50]<mstenta[m]>Oh wow!
[12:03:29]<symbioquine[m]>paul121[m]: Examples?
[12:04:58]<paul121[m]>this is the first that comes to mind - probably not too many:https://github.com/farmOS/farmOS/blob/11cc36accf9590426d846fa9cc766de268...
[12:13:19]<mstenta[m]>could probably grep for `drupalSettings.path.baseUrl`
[12:14:25]<symbioquine[m]>Won't `drupalSettings.path.baseUrl` include the path prefix?
[12:27:01]<symbioquine[m]>The docs on drupal.org seem pretty useless in that regard...
[12:27:59]<symbioquine[m]>You'd think a page like https://www.drupal.org/docs/drupal-apis/javascript-api/javascript-api-ov... would say, "Here's the 'core' JS libraries we provide and a description of what properties/methods are included"
[12:28:43]<symbioquine[m]>It seems like if I want "first-party" documentation for that stuff, my only option is the source code.
[12:30:00]<mstenta[m]>symbioquine: that's what the "Edit" button is for ;-)
[12:30:10]<mstenta[m]>(i agree - docs leave a lot to be desired)
[12:30:33]<paul121[m]>yea agreed... I'm not sure if drupaljs.net is official
[13:26:45]<FarmerEd[m]>Can I not use PATCH on an animal asset with the API?
[13:26:46]<FarmerEd[m]>I'm getting:
[13:26:46]<FarmerEd[m]> "No route found for "PATCH /api/asset/animal": Method Not Allowed (Allow: POST, GET, HEAD)"
[13:27:26]<symbioquine[m]>It's POST to create an asset
[13:27:41]<symbioquine[m]>PATCH would be for modifying one
[13:28:22]<symbioquine[m]>e.g. `https://v2.farmos.test:8080/api/asset/animal/b7d8cd9c-7463-4caa-af73-3de...`
[13:29:23]<FarmerEd[m]>I want to modify. I'm working on a Node Red flow to sync with Department of Ag database, so want to archive animals that exist in my farmOS database but not the Departments.
[13:29:47]<symbioquine[m]>https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi...
[13:30:02]<mstenta[m]>Modifications must be made to the specific UUID path
[13:30:02]<FarmerEd[m]>never mind I see I'm an idiot
[15:19:24]<tool172[m]>ACTION uploaded an image: (39KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/RgsrKtKzqOa... >
[15:19:35]<tool172[m]>so i had to rebulid my docker image and cleared out the volumes
[15:19:50]<tool172[m]>but now i'm confused why i'm seeing permission issues
[15:20:04]<tool172[m]>i copied the settings addition to the settings.php file for uploads
[15:20:14]<mstenta[m]>Do not use Drupal's built in updater!
[15:20:21]<tool172[m]>i'm not
[15:20:25]<tool172[m]>i'm uploading the tar.gz
[15:20:28]<mstenta[m]>(if that's what you're doing)
[15:20:30]<tool172[m]>for google maps
[15:20:33]<mstenta[m]>Oh ok haha
[15:20:55]<tool172[m]>i might go wipe the volumes...again
[15:21:10]<mstenta[m]>Oh just download the module tarball and unpack it in sites/all/modules
[15:21:30]<mstenta[m]>I've never used Drupal ui to download modules, so I can't vouch for it in this or any context
[15:22:09]<mstenta[m]>I'm sure it works fine but it's also a security concern to let drupal write code IMO
[15:22:50]<mstenta[m]>If everything else is working I wouldn't wipe volumes
[15:22:57]<mstenta[m]>Try downloading it manually
[15:23:15]<mstenta[m]>> i'm uploading the tar.gz
[15:23:15]<mstenta[m]>Oh sorry just saw this
[15:23:31]<mstenta[m]>(on my phone right now) :-)
[15:24:03]<mstenta[m]>If you are uploading tarball then you don't need to use whatever UI you screenshotted above
[15:24:37]<mstenta[m]>Just unpack it and go to /admin/modules to enable
[15:24:49]<tool172[m]>i just did it manually
[15:24:56]<tool172[m]>just wondering what else will be off
[15:25:02]<tool172[m]>had a bad gateway at timeout for using nginx proxy manager
[15:25:07]<tool172[m]>during install
[15:25:10]<tool172[m]>so that's down right now
[15:25:50]<mstenta[m]>> just wondering what else will be off
[15:25:50]<mstenta[m]>In regards to what?
[15:25:59]<mstenta[m]>Did the module install ok?
[15:27:42]<mstenta[m]>I'm just responding to your original screenshot and the fact you mentioned Google maps
[15:27:57]<mstenta[m]>(one thing at a time) :-)
[15:28:21]<tool172[m]>i manually unpacked it
[15:28:23]<tool172[m]>and it installed ok
[15:28:32]<tool172[m]>just wondering if something is aloof
[15:28:35]<mstenta[m]>Great
[15:28:38]<tool172[m]>now that it's all setup i'm going to re-proxy it
[15:30:03]<mstenta[m]>Don't worry about the error in your screenshot. That UI shouldn't be used to install/update modules either way. It probably isn't working because of file permissions but that's a good thing IMO for security reasons
[15:30:15]<tool172[m]>it isnt
[15:30:27]<tool172[m]>i just was wondering if a lot of that is limited in the docker configs
[15:30:34]<tool172[m]>i just through standard configs for now
[15:30:40]<tool172[m]>i'll manually migrate my db info
[15:30:55]<mstenta[m]>Gotcha yea probably
[15:31:05]<mstenta[m]>I gotta run.. back later
[15:31:17]<tool172[m]>later. I'm moving from standalone to docker so we shall see
[15:32:44]<tool172[m]>Farmer Ed if you have info on how your connecting with an extended module to Dept of AG id be interested. I want to develop a module to list sale barns in area with pricing for a label (IE stockers/hiefers/etc ) with moving averages to make informed decisions with data spanning 2 years.
[15:33:00]<tool172[m]>I kept trying to understand the scripting for REST but my brain was fried
[15:33:42]<tool172[m]>Plus stockyard data is of use to ranchers all the time :)
[15:34:38]<FarmerEd[m]>It's Department of Ag DAFM in Ireland?
[15:45:29]<tool172[m]>i'm in US
[15:45:37]<tool172[m]>but they have a rest api you can register for here
[15:52:01]<FarmerEd[m]>It's probably not vastly different.
[15:52:02]<FarmerEd[m]>I'm working on syncing my herd data with the Irish Cattle Breeders Federation (which in turn is connected with our Department of Ag).
[15:52:02]<FarmerEd[m]>I'm using Node Red and will be posting everything to Github.
[15:52:02]<FarmerEd[m]>Have you managed to do anything with the API at all yet?