IRC logs for #farmOS, 2021-12-14 (GMT)

2021-12-13
2021-12-15
TimeNickMessage
[19:06:24]<mstenta[m]>ooh good point paul121... yea maybe file system needs to be configured
[19:07:45]<mstenta[m]>sgoodall: where are you trying to upload them? what is the URL/path? there are a few different places where KMLs can be uploaded, so knowing which one you're trying would help us help you debug :-)
[08:19:28]* qoyyuum[m] has joined #farmos
[08:19:31]<qoyyuum[m]>Hey all
[08:20:18]<qoyyuum[m]>I'm currently using Farmier and was wondering if it has API endpoints exposed? I'm a noob at this so apologies in advance.
[08:21:10]<mstenta[m]>Hi qoyyuum yes API endpoints work on Farmier :-)
[08:21:35]<mstenta[m]>Note that Farmier only hosts 1.x instances currently, but will be offering 2.x in the near future
[08:21:55]<qoyyuum[m]>Wonderful! Now I'm not sure if the API docs on farmOS.org are showing for v1 or v2
[08:24:53]<mstenta[m]>farmOS.org is 1.x
[08:24:56]<mstenta[m]>docs.farmOS.org is 2.x
[08:25:11]<mstenta[m]>but we will be "flipping the switch" once the first beta release of 2.x is ready (soon)
[08:25:47]<qoyyuum[m]>How soon? Like new years soon?
[08:25:52]<mstenta[m]>the 2.x API docs are a bit sparse - but that's largely because a lot of it is generally documented here: https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi...
[08:26:16]<qoyyuum[m]>I see
[08:26:50]<mstenta[m]>somewhere around there - no guarantees - we have a few remaining open issues and some other stuff to get done before then - working around holidays etc :-)
[08:27:41]<qoyyuum[m]>That's fine then. I'm working on an improved Field Kit and since Farmier is on 1.x, I might just give that a go.
[08:28:24]<mstenta[m]>Oh cool - are you coordinating with jgaehring at all? He is working on version 2 of Field Kit as well
[08:28:57]<qoyyuum[m]>Not yet. Currently refactoring the Field Kit into a new framework for the moment.
[08:31:04]<mstenta[m]>Oh I see - do you plan to contribute changes back? Or fork the project? If contributing back then definitely coordinate with jgaehring - otherwise no guarantees it will be merged
[08:31:23]<mstenta[m]>I know a lot has been changing ahead of 2.x
[08:31:41]<qoyyuum[m]>I see. Sure I'll contact him soon
[08:32:03]<mstenta[m]>Great! Contributions are always welcome!
[08:46:35]<jgaehring[m]>Yea, looking forward to chatting!
[12:29:33]* sgoodall_ has joined #farmos
[12:38:57]* aislinnpearson[m has joined #farmos
[15:34:24]<SimonGoodall[m]><mstenta[m]> "sgoodall @jsgoodall:matrix.org..." <- It imports it correctly if I copy paste it into the text box, also generated by QGIS so doubt that this is the issue. Just need to understand where the file normally gets saved in the drupal/farmos context so that I can look at permissions and which log I should be looking at for errors, this way I can figure it out. Will research more.
[15:42:20]<SimonGoodall[m]><mstenta[m]> "sgoodall: where are you trying..." <- /asset/1/edit I have tried it here with the same result and under /asset/add as well
[15:50:26]<SimonGoodall[m]>core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php: $elements['#file_upload_title'] = t('Add a new file');
[15:50:26]<SimonGoodall[m]>I believe I found where to start looking
[15:52:57]<mstenta[m]>sgoodall: can you confirm that you have the "Private file system path" configured here: /admin/config/media/file-system
[15:53:16]<mstenta[m]>s/sgoodall: can you confirm that you have the "Private file system path" configured here: /admin/config/media/file-system/sgoodall: can you confirm that you have the "Private file system path" configured here: `/admin/config/media/file-system` (add that path to the end of your farmOS hostname)/
[15:53:57]<mstenta[m]>it looks like we need to add that to the hosting docs
[15:54:03]<mstenta[m]>we do have it in the dev environment docs here: https://docs.farmos.org/development/environment/#configure-private-files...
[15:54:35]<SimonGoodall[m]>mstenta[m]: Quite right, it is not set, thanks!
[15:54:48]<mstenta[m]>Oh good! That is most likely the problem
[15:54:56]<mstenta[m]>I will add that to our hosting docs right now :-)
[16:07:41]<mstenta[m]>https://docs.farmos.org/hosting/install/#file-uploads
[17:09:20]<SimonGoodall[m]>A couple more steps were needed to make it work apart from adding "$settings['file_private_path'] = '/opt/drupal/web/sites/default/files/private';" to the settings.php. Used the https://www.drupal.org/docs/8/core/modules/file/overview document to find it out. You need to create the sites/default/files/private directory and add the .htaccess with "Deny from all", then I also had to clean the cache. Working now. Thanks for the help!
[17:09:58]<mstenta[m]>Oh ok glad you got it working!
[17:10:54]<mstenta[m]>I *think* Drupal will create the directory and .htaccess automatically if `sites/default` is writable by Apache
[17:11:20]<mstenta[m]>Might be worth testing and updating docs accordingly
[17:12:51]<SimonGoodall[m]>I would know that if I would of cleared the cache before adding this line to the settings.php, but I did this after so not sure about this now.
[18:07:46]<SimonGoodall[m]>(2.0.0-alpha5) Funny how it is reading a kml file without actually dividing it into its individual polygons which in this case are the fields, it ends up all as a single asset. When I had tried it out in 1.x it had actually worked correctly ( I actually remember swearing to myself because I had not named all the fields/paddocks before importing and ended up doing this manually with the missing ones :)
[18:20:29]<paul121[m]>ohh sgoodall you have been uploading this kml to a single asset, correct? Either `/asset/1/edit` or `/asset/add` ?
[18:20:49]<SimonGoodall[m]>yep
[18:20:53]<paul121[m]>To create multiple assets you need to import it using the "KML importer" at `/import`
[18:22:51]<SimonGoodall[m]>uh..oh... thanks!!! Working like a charm
[18:23:01]<SimonGoodall[m]>ACTION feels dumb
[18:23:17]<paul121[m]>haha no, not at all
[18:23:23]<paul121[m]>we need to make that more visible
[18:23:54]<paul121[m]>I've also just discovered a bug with that on the latest `2.x-dev` so... thanks! :P
[18:25:51]<paul121[m]>when uploading a KML file to `/asset/1/edit` we call that "Populating the geometry from a file" and will only update the single asset. Importing is the larger process of creating assets. Really appreciate any feedback you have on these processes!
[18:26:59]<paul121[m]>And glad that you are testing them out! It's hard to test everyones KML files ourselves... so I'm glad it is working
[18:28:23]<SimonGoodall[m]>Me too... I was not really looking forward to rebuilding the polygons again.
[18:28:28]<SimonGoodall[m]>Will keep you posted
[18:30:16]<SimonGoodall[m]>Yes, maybe more clarity in the form with a non ambigious title will help. Like "Import single asset"
[18:33:16]<paul121[m]>yeah, just realizing the button is called "Import geometry from uploaded files". Maybe "import" is confusing in this context..
[18:33:26]<paul121[m]>ACTION uploaded an image: (18KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/yeFNvBGAUwB... >
[18:34:49]<SimonGoodall[m]>I think Import is correct because it is transforming a kml into an asset.
[18:35:02]<paul121[m]>maybe "Copy geometry from uploaded files" - we might be able to add a description below the button to the effect of "This will copy the geometry from uploaded files to this single asset. To import the geometry for multiple assets use the importer (link)"
[18:35:47]<SimonGoodall[m]>paul121[m]: description is a good idea. Saves on documentation
[18:36:00]<paul121[m]>well in this context it will only copy the geometry out of the KML. It won't use any of the other KML attributes
[18:38:09]<paul121[m]>sgoodall: are you a developer? Or only hosting farmOS right now? I think this would be a simple change if you're interested in opening a pull request :-)
[18:40:38]<SimonGoodall[m]>Yep, I'm a tinkerer and a developer, if you guide me through the process once ( or guide me to the documentation for it ) I will be able to do the right thing because I have never worked in a team before.
[18:42:08]<paul121[m]>Cool! Are you familiar with version control using git or github?
[18:43:14]<paul121[m]>Here is the relevant code: https://github.com/farmOS/farmOS/blob/1f8941aff954f2daf8b153b8c1dddc62cf...
[18:43:14]<paul121[m]>I think we just need to change the `#title` property, and maybe add a `#description`
[18:43:46]<SimonGoodall[m]>I'm using git but not in parallel with other people.
[18:45:43]<paul121[m]>I think you said you were using the production docker-compose file? If so it might be hard to make this change and see it locally
[18:45:58]<paul121[m]>You could try setting up a development docker-compose environment
[18:47:07]<paul121[m]>But this is fairly simple so you may be able to just do `git clone https://github.com/farmOS/farmOS.git` to get the source code and make changes
[18:49:56]<paul121[m]>Once you have some changes, you could push them to your own fork of farmOS on github, and make a pull request. Some docs on that here: https://docs.github.com/en/pull-requests/collaborating-with-pull-request...
[18:50:49]<paul121[m]>(may be able to make changes in the Github UI even)
[18:51:28]<SimonGoodall[m]>paul121: great, I will look into this tomorrow with more time, I'll set up a dev environment on my local network
[18:51:47]<SimonGoodall[m]>where should I be when I do the git clone request?
[18:51:52]<SimonGoodall[m]>which directory
[18:52:31]<paul121[m]>Ah, if you follow the instructions for the docker-compose development environment the repository will actually be cloned for you!
[18:52:55]<paul121[m]>You would just need to add your github fork as a "remote". That is where you would push up your changes
[18:52:56]<SimonGoodall[m]>ok, perfect, let me read up on it, I have already taken up enough of your time already :)
[18:53:35]<paul121[m]>the git repo will be in `www/web/profiles/farm`
[18:53:46]<paul121[m]>no problem!