Commit 1eeb34a2 authored by Josha Hubbers's avatar Josha Hubbers Committed by Josha Hubbers
Browse files

Issue #3267295 by JoshaHubbers: DataB with one document in the response

parent 0e830b68
Loading
Loading
Loading
Loading
+6 −0
Changes for modules/dvg/dvg_datab/dvg_datab.module: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -120,6 +120,12 @@ function dvg_datab_doclist($bsn) {
  $documents_array = [];

  if (!empty($data['response']['document'])) {
    if (!empty($data['response']['document']['docid'])) {
      // There is only one document, and this is in the root, not nested.
      $document = $data['response']['document'];
      $data['response']['document'] = [];
      $data['response']['document'][] = $document;
    }
    foreach ($data['response']['document'] as $document) {
      // Assure attachments are always sub-arrays.
      if (!empty($document['bijlage']) && isset($document['bijlage']['bijlid'])) {