Plone Vocabulary works fine in Plone Classic but is empty in Volto

@jaroel,
Using the following code:

unit = context.aq_parent.define_unit
alt_brains1 = api.content.find(portal_type='unit_goal', unit=unit)
print('alt_brains1', alt_brains1)
alt_brains2 = api.content.find(unit=unit)
print('alt_brains2', alt_brains2)

This is the output I got (also using pdb debugger):

(Pdb) for item in api.content.find(portal_type='unit_goal', unit=context.aq_parent.define_unit): item.unit_goal
'AAC Program/Unit Goal 3'
'AAC Program/Unit Goal 1.'
'AAC Program/Unit Goal 2.'
(Pdb) for item in api.content.find(unit=context.aq_parent.define_unit): item.unit_goal
'AAC Program/Unit Goal 1.'
Missing.Value
Missing.Value
Missing.Value
Missing.Value
'AAC Program/Unit Goal 3'
'AAC Program/Unit Goal 1.'
'AAC Program/Unit Goal 2.'
Missing.Value

I see for the second one with api.content.find(portal_type='unit_goal', unit=unit) it returns Missing.Value as one of the results.

To me, much of the code looks strange (sorry, I dont have time to look at it too closely now)

  1. If you have an item in a folder, and the folder has a field 'unit_goal' and 'unit_goal' also is an index, you can get it, for example by :
    goal = context.aq_parent.unit_goal.

  2. Then you can find (other) items inside that folder with plone.api.find(portal_type="UnitType", unit_goal=goal)

(assuming unit_goal if a string or something else 'usable')

Then, when you loop through the items, you append value, token and title,
I think I have used brain.UID for the value and/or token and brain.Title for title.

Then, I would look up the item (if you need that) in the template by uid, for example

plone.api.content.get(UID=something)

Alternatively, you could store a relation and look it up by 'to_object' ( https://docs.plone.org/external/plone.app.dexterity/docs/advanced/references.html ), but that is probably 'more difficult to ''understand'' how to do'.

ok, please use unit = context.aq_parent.define_unit instead of unit = api.content.get(UID=context.aq_parent.UID()).define_unit and things should be moving forward again.

If this doesn't help, you should find a Plone solution provider nearby.