diff --git a/services/ExportService.php b/services/ExportService.php index 064dc5a..96b8b3b 100644 --- a/services/ExportService.php +++ b/services/ExportService.php @@ -449,6 +449,7 @@ public function parseFieldData($handle, $data) case ExportModel::FieldTypeDropdown: // Resolve to string $data = (string) $data; + $data = preg_replace('/\r|\n/', '', $data); break; case ExportModel::FieldTypeCheckboxes: diff --git a/services/Export_UserService.php b/services/Export_UserService.php index 99b0c0d..94cab93 100644 --- a/services/Export_UserService.php +++ b/services/Export_UserService.php @@ -116,7 +116,9 @@ public function setCriteria(array $settings) $criteria->status = isset($settings['map']['status']) ? $settings['map']['status'] : null; // Get by group - $criteria->groupId = $settings['elementvars']['groups']; + if (isset($settings['elementvars']) && isset($settings['elementvars']['groups'])) { + $criteria->groupId = $settings['elementvars']['groups']; + } return $criteria; } diff --git a/templates/_map.twig b/templates/_map.twig index 2b07a67..ee5416b 100644 --- a/templates/_map.twig +++ b/templates/_map.twig @@ -16,59 +16,62 @@ {% endfor %} - {% for key, value in export.elementvars %} - {% if value is iterable %} - {% for subvalue in value %} - - {% endfor %} - {% else %} - - {% endif %} - {% endfor %} + {% if export.elementvars is defined %} + {% for key, value in export.elementvars %} + {% if value is iterable %} + {% for subvalue in value %} + + {% endfor %} + {% else %} + + {% endif %} + {% endfor %} + {% endif %}
{{ "Choose which fields you want to export."|t }}
|
-
-
-
-
-
- {% if data.entrytype is defined %}{% endif %}
-
- |
-
-
-
-
-
-
-
- |
- - {{ forms.checkboxField({ - label: 'Include in export'|t, - instructions: "This value will be included in the export file."|t, - name: "fields[" ~ handle ~ "][checked]", - checked: data.checked - }) }} - | -
|
+
+
+
+
+
+ {% if data.entrytype is defined %}{% endif %}
+
+ |
+
+
+
+
+
+
+
+ |
+ + {{ forms.checkboxField({ + label: 'Include in export'|t, + instructions: "This value will be included in the export file."|t, + name: "fields[" ~ handle ~ "][checked]", + checked: data.checked + }) }} + | +