Problem
When creating a new form (through Contact Forms), the user can define the form display and view display. Both are working fine when viewing a form or a submission (using the Contact Messages module). However, when the visitor clicks on preview before submitting, the preview shows the individual form field values in an apparently random order.
Inspecting the HTML, it seems, all previewed fields are sorted by their machine name. I am not sure, how the preview is built, in MessageForm.php it says
$form['preview']['message'] = $this->entityManager->getViewBuilder('contact_message')->view($message, 'full');
but I can't find the correct implementation of that function to take a look.
I think, the correct viewBuilder is in the Contact Storage module which is currently Third-Party but seems to be on its way to become part of Drupal 8.3.x (see #2750629: Add view builder for contact module's Message entity β ). Then I get lost where to look next in order to change the sorting to use weights.
Needs work
10.1 β¨
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.