- First commit to issue fork.
There is a webform on a site, where the webform is created in french and it's translated into dutch. These webforms are regularly exported in a CSV file. For this, we fetch the webform data through \Drupal\beobank_api\Utility\SubmissionBase::getFormData on the submission first. Then through the form data, we fetch the webform through \Drupal\webform\Entity\WebformSubmission::getWebform.
Now we notice that not all fields are exported. Looking further, we see only elements that have actually translated labels are exported.
It seems \Drupal\webform\Entity\Webform::initElementsTranslation can't get all the elements, since the webform object has in both elements and elementsOriginal, the translated elements, but no elements for which no translated configuration is stored.
Part of it is because that's the way data is fetched in \Drupal\Core\Config\Entity\ConfigEntityStorage::doLoadMultiple, so there's not much that can be done there I fear. Unless a major change in \Drupal\webform\Entity\Webform::postLoad is done.
However in \Drupal\webform\Entity\Webform::getElementsDecodedAndFlattened or in \Drupal\webform\Entity\Webform::initElements something could be done about this maybe.
$formData = $submission->getFormData();
$form = $formData->getWebform();
$fields = $form->getElementsDecodedAndFlattened();
To be checked.
Needs review
6.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.