[05:00:12] | * FeiWang[m] has quit (Quit: You have been kicked for being idle) |
[12:58:27] | <MarcosCarballal[> | Hey all :). I was doing some digging in the farmOS repo in the core code to see how you guys are defining your assets/logs... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/b03d6f08b6...) |
[13:00:08] | <mstenta[m]> | Hi Marcos Carballal |
[13:01:17] | <mstenta[m]> | `FarmFieldFactory` is basically just a helper class that farmOS provides: https://github.com/farmOS/farmOS/blob/2.x/modules/core/field/src/FarmFie... |
[13:01:57] | <mstenta[m]> | It provides a few methods, but ultimately all it does is help to return a field definition object for use by Drupal core. |
[13:02:39] | <mstenta[m]> | You don't need to use it - you can create field definitions yourself using the standard Drupal core classes... (I'll dig up a reference on that, one sec) |
[13:03:21] | <mstenta[m]> | Drupal core has some idiosyncrasies in it's field definition logic... which adds some silly complications (there are open issues upstream to simplify things) |
[13:03:31] | <mstenta[m]> | So the reason we provide that class is twofold: |
[13:03:40] | <mstenta[m]> | 1. To work around some of Drupal core's legacies |
[13:03:59] | <mstenta[m]> | 2. To offer some consistency in field definition creation for farmOS specifically |
[13:04:41] | <mstenta[m]> | So that, for example, a contrib module developer who wants to add a timestamp field to an entity can do so using our helper, and it will guarantee that it will work the same as all other timestamp fields in farmOS core |
[13:05:05] | <mstenta[m]> | (because there are always more than one way to do things when you get to a lower level - so we try to standardize some things at the farmOS application level) |
[13:06:08] | <mstenta[m]> | https://www.drupal.org/docs/drupal-apis/entity-api/defining-and-using-co... |
[13:09:18] | <mstenta[m]> | Depending on what you're hoping to do, I may be able to point you in the right direction (with reasoning)... |
[13:09:50] | <mstenta[m]> | I won't send you down the Drupal core rabbit hole for all the considerations involved unless you want ... :-) |
[13:09:55] | <MarcosCarballal[> | Thanks for that link Mike! Helps to understand where the `$options` object is actually being read. I think that we will try and leverage that FarmFieldFactory as much as possible. |
[13:10:20] | <MarcosCarballal[> | As long as that's what it's there for 🙂 |
[13:10:29] | <mstenta[m]> | Cool! Yea - it's helpful - although you may run into cases where it's too limiting too - so learning some of the lower level stuff isn't a bad idea |
[13:12:58] | <MarcosCarballal[> | Are you able to speak to the difference between buildFieldDefinitions() and bundleFieldDefinitions()? |
[13:16:04] | <mstenta[m]> | might need some more specifics... do you mean the two `public` methods on the `FarmFieldFactory` class? `baseFieldDefinition()` and `bundleFieldDefinition()`? |
[13:16:05] | <mstenta[m]> | https://github.com/farmOS/farmOS/blob/2.x/modules/core/field/src/FarmFie... |
[13:16:24] | <mstenta[m]> | Or do you mean a method on the Asset/Log type plugin class? |
[13:17:01] | <mstenta[m]> | Oh I see ... (looking at the bit you copied from `Harvest.php` up above...) |
[13:17:42] | <mstenta[m]> | (Log type plugin class) |
[13:21:38] | <mstenta[m]> | > Are you able to speak to the difference between buildFieldDefinitions() and bundleFieldDefinitions()? |
[13:21:38] | <mstenta[m]> | Do you mean `bundleFieldDefinition()` (no `s` at the end, like what is used in the `Harvest` class's `buildFieldDefinitions()` method)? Just want to be sure... |
[13:22:33] | <mstenta[m]> | The `Harvest` class's `buildFieldDefinitions()` method allows you to add fields to that specific bundle - it expects an array of `BundleFieldDefinition` objects (if i remember correctly) |
[13:23:08] | <mstenta[m]> | There are basically two kinds of fields: "base" fields and "bundle" fields. |
[13:23:36] | <mstenta[m]> | Base fields will be added to ALL bundles of a particular entity type (eg: all log types) |
[13:23:49] | <mstenta[m]> | Bundle fields will be added to ONE bundle of a particular entity type (eg: harvest logs) |
[13:24:45] | <mstenta[m]> | So in https://github.com/farmOS/farmOS/blob/9f645c0470df1236bbba15e67234e4dfae...... |
[13:24:54] | <mstenta[m]> | `$fields['lot_number'] = $this->farmFieldFactory->bundleFieldDefinition($options);` |
[13:26:49] | <mstenta[m]> | ^ that is basically using `FieldFarmFactory` (which is automatically made available in the `Harvest` class as `$this->fieldFarmFactory()`) is returning a `BundleFieldDefinition` object... which is then being added to the array of fields returned by `Harvest::buildFieldDefinitions()` - so it will be added as a bundle field to harvest logs |
[13:39:22] | <MarcosCarballal[> | <mstenta[m]> "Base fields will be added to ALL..." <- Ah! of course. Thanks Mike! |
[13:39:23] | <MarcosCarballal[> | `buildFieldDefinitions()` has no arguments as far as I can tell. |
[13:39:23] | <MarcosCarballal[> | I think I have enough to off of here to try and write my own. Off I go. |
[13:39:33] | <MarcosCarballal[> | > <@mstenta:matrix.org> Base fields will be added to ALL bundles of a particular entity type (eg: all log types) |
[13:39:33] | <MarcosCarballal[> | * Ah! of course. Thanks Mike! |
[13:39:33] | <MarcosCarballal[> | `buildFieldDefinitions()` has no arguments as far as I can tell. |
[13:39:33] | <MarcosCarballal[> | I think I have enough to go off of here to try and write my own. Off I go. |
[13:41:04] | <mstenta[m]> | Correct |
[13:41:08] | <mstenta[m]> | Sounds good! Good luck! |
[13:59:35] | * monkeyflowerfarm has joined #farmos |
[14:01:54] | <monkeyflowerfarm> | Hello, Im getting ready to install a new version of Farmos and I noticed the preferred method is not available to me because Im on a shared server. What is the best way to install with out composer or Docker? |
[14:03:19] | <mstenta[m]> | The other "recommended" approach (aside from Docker) is via a "Packaged release" tarball: https://farmos.org/hosting/install/#packaged-releases |
[14:03:45] | <mstenta[m]> | Be sure to check that your shared hosting environment meets the requirements! |
[14:03:49] | <TheSlurpee[m]> | monkeyflowerfarm: installing on a shared hosting sever might be difficult. |
[14:03:55] | <mstenta[m]> | https://farmos.org/hosting/install/#server-requirements |
[14:05:24] | <monkeyflowerfarm> | I will be moving to my own dedicated but I would like to get it up and running in the mean time. I have a farmos site now running in shared environment but I want to start over. |
[14:06:46] | <monkeyflowerfarm> | BTW I want to say thanks to all who have worked on this very cool project! |
[14:08:42] | <TheSlurpee[m]> | monkeyflowerfarm: one trick to "starting fresh" with a Drupal type CMS based on mysql is type "drop database dbname" and then "create database dbname" via mysql clu |
[14:08:43] | <TheSlurpee[m]> | s/clu/cli/ |
[14:09:42] | <monkeyflowerfarm> | Ok so just start a new database? change settings file and reload? |
[14:10:56] | <mstenta[m]> | Everything you need to know is here: https://farmos.org/hosting/install |
[14:11:10] | <mstenta[m]> | (let us know if anything's missing or unclear!) |
[14:14:57] | <monkeyflowerfarm> | Ok great thanks! |
[14:16:07] | <mstenta[m]> | one thing that the packaged releases assume, however (like the Docker images), is that you can point your Apache at the `web` subdirectory of the packaged release |
[14:16:30] | <mstenta[m]> | not sure if all shared hosting environments provide that option |
[14:16:58] | <mstenta[m]> | (it keeps `vendor` code and some other things outside of the webroot) |
[14:49:42] | <monkeyflowerfarm> | Is there a sales invoice accounting component to farm os? |
[14:50:50] | <mstenta[m]> | Not really. There is an add-on module called farmOS Ledger which adds Sale and Purchase log types: github.com/farmOS/farm_ledger/ |
[14:51:04] | <mstenta[m]> | But that is not a full-fledged invoicing system by any means |
[14:51:16] | <mstenta[m]> | It basically just gives you log types for recording sales/purchases in relation to other assets you're managing |
[14:51:48] | <mstenta[m]> | There is some discussion in this forum topic you might like to follow: https://farmos.discourse.group/t/financial-accounting-software-to-pair-w... |
[14:51:55] | <TheSlurpee[m]> | It would be rather easy to build invoices with Views in Drupal that output as a PDF in an invoice based layout. |
[14:52:24] | <mstenta[m]> | TheSlurpee: are you volunteering? ;-) |
[14:53:21] | <monkeyflowerfarm> | TheSlurpee: 👍️ |
[14:54:02] | <mstenta[m]> | I was co-maintainer of this old module a long time ago: https://www.drupal.org/project/invoice |
[14:54:48] | <TheSlurpee[m]> | Well, I have accomplished similar requests in Drupal and I have been extensively building out Views in D9 + farmos lately, so, sure, I'll volunteer. Kinda had it on my radar :) |
[14:55:10] | <mstenta[m]> | Wow I was half-joking - that's great to hear! :-D |
[14:55:23] | <monkeyflowerfarm> | Im still working in D7 |
[14:55:30] | <monkeyflowerfarm> | :) |
[14:55:55] | <TheSlurpee[m]> | Related, creating labels that fit popular label softwares, Avery, Zebra, etc is higher on the priority list, but really closely related. |
[14:55:56] | <mstenta[m]> | monkeyflowerfarm: but you are planning to start fresh with farmOS v2, is that right? v2 is Drupal 9 |
[14:56:27] | <mstenta[m]> | (if not then i gave you the wrong installation docs link above) |
[14:57:41] | <monkeyflowerfarm> | I just started over w new database and Im using version 7.x-1.7 |
[14:58:32] | <monkeyflowerfarm> | or thats the install profile number not sure which version |
[14:59:47] | <monkeyflowerfarm> | Do you recommend Drupal 9 vs Drupal 7 for FarmOs? |
[15:00:33] | <mstenta[m]> | Oh I definitely recommend v2 |
[15:00:45] | <mstenta[m]> | We are no longer developing v1 |
[15:01:15] | <mstenta[m]> | latest tarball release is available here: https://github.com/farmOS/farmOS/releases/tag/2.0.0-beta3 |
[15:01:27] | <mstenta[m]> | `farmOS-2.0.0-beta3.tar.gz` |
[15:02:01] | <mstenta[m]> | Note that you don't download Drupal and then install farmOS. You JUST download farmOS (it includes Drupal) |
[15:02:30] | <monkeyflowerfarm> | yes thank you |
[15:04:18] | <monkeyflowerfarm> | I have been using drupal for 14 years love it. We just started a new Organic Farm here in Ncal. I would love to help if there is anything I can do. Thank You |
[15:04:32] | <mstenta[m]> | oh awesome! |
[15:04:42] | <mstenta[m]> | always helpful to have some drupal experience! :-) |
[15:05:03] | <mstenta[m]> | have you worked with Drupal 8+ much? |
[15:06:17] | <mstenta[m]> | (just thought of one other thing re: shared hosting - you must use PHP 7.4 - PHP 8 is not supported just yet... (mostly upstream dependencies) https://www.drupal.org/project/farm/issues/3186530) |
[15:06:41] | <monkeyflowerfarm> | I tried too but I tend to gravitate towards versions that have module support because I have yet to write a module (next step). |
[15:06:44] | <mstenta[m]> | (someone else ran into that, but their host had the ability to specify the PHP version so they were able to select PHP 7.4 - hopefully you can too) |
[15:07:02] | <monkeyflowerfarm> | Thanks yes I have it set to 7.4 |
[15:07:30] | <mstenta[m]> | The PHP config listed on https://docs.farmos.org/hosting/install/ also snagged a few people in the past - so make sure you set those values |
[15:07:55] | <mstenta[m]> | (mostly the `memory_limit` and `max_execution_time` if i remember correctly) |
[15:08:11] | <monkeyflowerfarm> | cool |
[15:19:34] | * botlfarm[m] has joined #farmos |
[15:19:34] | <botlfarm[m]> | mstenta: I am finding small features or issues with 2.x that used to be around with 1.x. I just created a forum post with one of them, but not sure that is where you want that type of stuff. I found another and figured I would ask before creating another topic. |
[15:19:34] | <botlfarm[m]> | The new one is when adding a Quantity the quantity labels used to auto complete with past used labels. Thy no longer do. Not sure again if this is design choice or just something that was missed or something that is on a to do list for some point later. |
[15:22:45] | <mstenta[m]> | botlfarm: Thanks Nick! Forum topics are probably the best place... I can link to existing issues if we have them. Saw your recent one - will reply when I have a chance. |
[15:24:30] | <botlfarm[m]> | Sounds good. I will post in the forum as I find them. |
[15:24:32] | <mstenta[m]> | I'm hoping we can find some funds for "general improvements" in the near future, to put towards things like this that might not be part of other funded work. |
[15:25:21] | <mstenta[m]> | Use the `feature-request` tag in the forum topic so we can find them easily! |
[15:27:14] | <botlfarm[m]> | My programing brother-in-law has his retirement scheduled in late May. hopefully I can get him onboard to start helping with these type of things ASAP. 😀 |
[15:27:27] | <mstenta[m]> | > Not sure again if this is design choice or just something that was missed or something that is on a to do list for some point later. |
[15:27:27] | <mstenta[m]> | To answer this more generally: since v2 was essentially a "rebuild" there are probably a number of little things that were left behind, either intentionally or not. and by "intentionally" it may just mean "we needed to focus on more important bits, so we'll wait and see if we hear that this is still desired in v2" - so it's good info when we hear that something's missing! |
[15:27:35] | <mstenta[m]> | Awesome! |
[15:28:23] | <botlfarm[m]> | That was my thought. v2 is working and I'm sure that was the main goal. |
[15:28:58] | <mstenta[m]> | yup |
[15:29:47] | <mstenta[m]> | my hope was v2 would be 100% parity with v1, and i would say we got as close as we could given the resources we had |
[15:31:03] | <botlfarm[m]> | Absolutely! You and the team did great. Im loving the new UI |
[15:53:43] | * MattFletcher[m] has joined #farmos |
[17:59:39] | <monkeyflowerfarm> | installing v2 from tar on shared host the contents of the web folder are installed on the web root, what other dependencies are in the additional content and what is the path structure? |
[18:41:10] | <mstenta[m]> | monkeyflowerfarm: i'm not sure i understand your question |
[18:42:29] | <mstenta[m]> | you have your webserver (Apache?) pointing to the `web` subdirectory as the site's webroot? and the `vendor` directory is outside of the webroot, correct? |
[18:43:03] | <mstenta[m]> | i don't understand these questions: "what other dependencies are in the additional content and what is the path structure?" |