< 052021-04-06⋎07 >

farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Feature requests and bug reports: github.com/farmOS/farmOS/issuesSet by ChanServ on 2018-08-16 at 14:32
15:54skipper_is[m]...How do you use a taxonomy as an autofill?
15:55mstenta[m]are you trying to add an "autocomplete" text field to a form?
15:55mstenta[m]maybe something like this?
15:55mstenta[m]github.com/farmOS/farmOS/blob/92f854b9be
15:58skipper_is[m]Yea, and that seems to correlate to the taxonomy of farm_crop, but when i do the same for my own taxonomy (with some values already in it) it says it cannot find the taxonomy
15:59skipper_is[m]"Taxonomy field quick_medical not found."
15:59skipper_is[m](Also, the autocomplete for vets, in medical logs, is that autocomplete usable in forms? Is it also from a taxonomy?)
16:02* < matrix.org/_matrix/media/r0/download/mat >
16:14mstenta[m]ah... so `taxonomy/autocomplete/field_farm_crop` essentially works by leveraging the fact that there is a field called `field_farm_crop` (for referencing terms in the vocabulary)
16:15mstenta[m]do you have a field set up? if so make sure you use that field's name in the autocomplete path
16:16skipper_is[m]I have not, I have a taxonomy with a bunch of medicines as terms
16:17mstenta[m]ok - so if you add a term reference field to a log type, then you can reference that field's name in the autocomplete path and it should work
16:17mstenta[m]the field is where you configure "this field references terms in this vocabulary"
16:17mstenta[m]so it makes that connection
16:17mstenta[m]we just went with that approach because it was already set up and met our needs... i don't know if Drupal core provides a more general term reference autocomplete path
16:17mstenta[m]but the cool thing is: you can also just make your own routes for autocomplete paths
16:17mstenta[m]if you need something more custom
16:18skipper_is[m]so field_farm_vets should work as an autocomplete?
16:18skipper_is[m](it doesn't seem to)
16:18mstenta[m]github.com/farmOS/farmOS/blob/c5c15043cf
16:19mstenta[m]if you have a field called `field_farm_vets` which is a term reference field to the vocabulary you want... it should
16:19skipper_is[m]the log_medical has a field called field_farm_vets
16:19skipper_is[m]By default
16:20mstenta[m]oh, but that's not a term reference field
16:20mstenta[m](`field_farm_vet` correct?)
16:20mstenta[m]that's just a string field
16:21mstenta[m]we provide an autocomplete for that as well, however :-)
16:21mstenta[m]it's just not a term autocomplete...
16:21mstenta[m]and in fact, that uses the custom module i just linked to above
16:22mstenta[m]the `farm_fields_autocomplete` module in farmOS 1.x provides auto-complete for all text fields on logs... by searching the database for previously entered values
16:22mstenta[m]maybe that's what you want?
16:23skipper_is[m]So can I plug field_farm_vet into that?
16:23mstenta[m]possibly! just need to figure out the right path to use...
16:24mstenta[m]`farm/fields/autocomplete/[entity type]/[bundle]/[field name]`
16:24mstenta[m]so try this:
16:25mstenta[m]`'#autocomplete_path' => 'farm/fields/autocomplete/log/farm_medical/field_farm_vet',`
16:25skipper_is[m]oh nice one, cheers
16:28skipper_is[m]An I guess likewise I can use farm/fields/autocomplete/log/farm_medical/name to get an autocomplete of medical log names?
16:28mstenta[m]should work!
16:28skipper_is[m]Or can i just do farm/fields/autocomplete/log/name?
16:28skipper_is[m]And get all the logs?
16:29mstenta[m]no - needs the bundle too
16:29skipper_is[m]Ah ok, some of them have a +, can I choose multiple bundles (the assets/group one is assets+group)
16:29mstenta[m]i don't remember if there's support for that or not in `farm_fields_autocomplete.module`
16:30mstenta[m]you could probably see how it works pretty easily
16:30mstenta[m]gotta sign off... taking over with the kids :-)
16:30mstenta[m]good luck!
16:30skipper_is[m]Diolch yn fawr!
17:26skipper_is[m]Is there an autocomplete for quantity labels? There is for quantity units, and in the log forms there is one for quantity, but can we hook in?
17:27mstenta[m]Good question
17:27mstenta[m]The same URL as before might work
17:28mstenta[m]The entity type would be field_collection
17:28mstenta[m]Bundle is field_farm_quantity
17:28mstenta[m]Field is field_farm_quantity_label
17:28mstenta[m]I think
17:29skipper_is[m]farm/fields/autocomplete/log/field_collection/field_farm_quantity/field_farm_quantity_label
17:30skipper_is[m]Goodness me that is a good length
17:30mstenta[m]Minus the log piece
17:30mstenta[m]Haha yes... The field collections are messy like that
17:31mstenta[m]FWIW it would be /farm/fields/quantity/standard/label in farmOS 2.x
17:32skipper_is[m]At one point I'll get farmOS2 installed and start finding the weird bugs
17:33mstenta[m]Hahaha
17:33mstenta[m]Also FWIW farmOS 2.x doesn't have a farm_fields_autocomplete module yet
17:34mstenta[m]@paul121 did some research into an alternative module we might be able to use
17:35skipper_is[m]`farm/fields/autocomplete/field_collection/field_farm_quantity/field_farm_quantity_label` is returning [] when I open the URL, suggesting it is working, but doesn't seem to return any values when I actually use it, which is a shame
17:36skipper_is[m]field_collection_item!
17:52mstenta[m]oh yesss
20:05skipper_is[m]If creating notes programatically, how can I get a newline in?
20:06skipper_is[m]I tried <br> and \n
20:06skipper_is[m]oh < b r >
20:06skipper_is[m]didn't let me type it
20:30skipper_is[m]"/n" instead of '/nl'
20:30skipper_is[m]*'/n'

< 052021-04-06⋏07 >