Hi all,
On my Plone 5.2 instance, I developed a standalone form following https://docs.plone.org/develop/addons/schema-driven-forms/index.html The form includes a select field that uses a vocabulary.
While the user is logged in, the select field loads its options from the vocabulary using mockup magic (great!). But when logged out, the magic does not happen. No select2-container
div with the choices is inserted above the input field, apparently causing the field to then display as a standard text input...
While logged in, there is an explicit request for http://localhost:8000/Plone/++resource++mockup/base/pattern.js I don't see it in the anonymous request although pattern.js can be loaded anonymously.
@@getVocabulary?name=my_theme.MyVocabulary&field=my_field
is also accesible for anonymous users. Not sure if these two data points are relevant.
I fail to understand what is supposed to insert the select2-container
element, and which next steps I could take to fix... Any hints are much appreciated!
Here are the relevant HTML snippets in each case (reformatted for readability). All other parts are identical.
Logged in:
<div class="fieldErrorBox"></div>
<div class="select2-container select2-container-multi
pat-select2 text-widget choice-field select2-orderable"
id="s2id_autogen5">
<ul class="select2-choices">
<li class="select2-search-field">
<label for="s2id_autogen6" class="select2-offscreen"></label>
<input type="text" autocomplete="off" autocorrect="off"
autocapitalize="off" spellcheck="false" class="select2-input"
id="s2id_autogen6" style="width: 10px;" placeholder="">
</li>
</ul>
</div>
<input class="pat-select2 text-widget choice-field" type="text"
name="form.widgets.my_field" value=""
data-pat-select2="{"separator": ";",
"vocabularyUrl": "http://localhost:8000/Plone/@@getVocabulary?name=my_theme.MyVocabulary
&field=my_field", "maximumSelectionSize": 1,
"allowNewItems": "false", "orderable": true}"
tabindex="-1" style="display: none;">
Logged out:
<div class="fieldErrorBox"></div>
<input class="pat-select2 text-widget choice-field"
name="form.widgets.my_field" value=""
data-pat-select2="{"separator": ";",
"vocabularyUrl": "http://localhost:8000/Plone/@@getVocabulary?name=my_theme.MyVocabulary
&field=my_field", "maximumSelectionSize": 1,
"allowNewItems": "false", "orderable": true}"
type="text">