So I’m using the Material Quantity type pretty extensively and the Material Taxonomy list. I’ve hit a snag, which is currently you may only link a single Material Taxonomy term to a Material Quantity log. In my cases, I’m using this field primarily as a reference for the types of materials included in this quantity. So I could add a herbicide named ‘greg’s horrible herbicide’, and enter:
Quantity
value: 10
relationships
material
herbicide
greg’s horrible herbicide
Another example: I’m adding mixes of products - a mix of fertilizers “hog manure”, “cow manure”, “chicken manure”.
Quantity
value: 10
relationships
material
hog manure
cow manure
chicken manure
I know that if I were doing inventory tracking, this conceptually wouldn’t make sense because I don’t know of the ‘value: 10’ which parts apply to which manure type. But I don’t care and I don’t even know, what I care about is knowing the component parts of whatever I applied (I might not even have a value! Sometimes I just use the quantity to reference material taxonomy terms).
Workarounds like making 3 different quantities and adding the value: 10 to one of them are wonky and furthermore provide inaccurate information (I didn’t add value: 10 for just the hog manure and nothing of the rest… it was a mix…). I also don’t want to use comma separate values, because you end up with a mess in your material taxonomy terms which I really want to effectively use.
So… would allowing material to reference multiple taxonomy_term--material cause issues / break anything in your modules / code? (remember, currently it allows only 1 reference).
I hope this is a small change, but I wanted to ask and see if anyone felt this could break something.
Makes sense to me. I think the main question will be whether or not this is a “breaking change”. I don’t think it would be, but I’ll have to take a closer look…
It’s funny because you’re essentially asking for something we had in farmOS v1… which was too limited/ambiguous (couldn’t track granular quantity of each ingredient in a mix) and was the motivation for moving the material type reference to the quantity.
But when we did that, we just assumed that single term references were the only requirement. But what your describing does make sense… as a slightly less granular way of recording things… similar to v1, but still on the quantity.
Discussed in the FarmOS call 4/27/2023… turns out there is a breaking change because relationships.materials in the API goes from being a single object to an array :\ bummer that’s a breaking change.
So we’ll add a request for FarmOS 3.x, and we’ll add a module to change it in SurveyStack managed instances and other farmers using these tools.
Open a dedicated farmOS | Drupal.org issue for making this change, with a patch or merge request, and mark the status as “Postponed” - so it’s ready to merge when the 3.x branch is opened.
Enable altering of bundle fields (needs an issue of it’s own).
Create a contrib “shim” module that alters the core material reference field definition to set 'multiple' => TRUE - for instances that want to enable this before 3.x.
Open a dedicated farmOS | Drupal.org issue for making this change, with a patch or merge request, and mark the status as “Postponed” - so it’s ready to merge when the 3.x branch is opened.