statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

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

Open arthurperton opened 4 years ago

arthurperton commented 4 years ago

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):

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