v2-hub icon indicating copy to clipboard operation
v2-hub copied to clipboard

CP: Suggestions not preloaded for fields in partials (fix included)

Open arthurperton opened this issue 5 years ago • 0 comments

Describe the bug When editing an entry, the suggestions for any fields in partials are not preloaded.

To Reproduce

  1. Create a collection with a fieldset.
  2. In that fieldset, use at least one partial.
  3. In the partial fieldset, use a suggest-like field type, e.g. 'collection'.
  4. While editing an entry, use the inspector in your browser to find out that there are no preloaded suggestions in JavaScript and the suggestions are loaded by xhr / ajax.

Expected behavior Suggestions for fields in partials should be preloaded too.

Environment details (please complete the following information):

  • Statamic Version 2.11.8

Fix FIX: in statamic/core/CP/Publish/PreloadsSuggestions.php line 15 should read $this->getSuggestFields($fieldset->inlinedFields()) instead of $this->getSuggestFields($fieldset->fields())

arthurperton avatar Feb 10 '20 15:02 arthurperton