Skip to content

Commit f466703

Browse files
committed
v2.0.0-beta.9
1 parent 47ed102 commit f466703

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Solspace Freeform Changelog
22

3+
## 2.0.0-beta.9 - 2018-02-16
4+
### Changed
5+
- Updated Dynamic Recipients fields to allow multiple email addresses per option (separated by commas).
6+
7+
### Fixed
8+
- Fixed a bug where radio fields would not display errors if left empty.
9+
- Fixed a bug where the demo templates errored on submission views after Craft 3 RC 10 update.
10+
311
## 2.0.0-beta.8 - 2018-02-14
412
### Fixed
513
- Fixed a bug where the CP Submissions list page broke after Craft 3 RC 10 update.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "solspace/craft3-freeform",
33
"description": "The most intuitive and powerful form builder for Craft.",
4-
"version": "2.0.0-beta.8",
4+
"version": "2.0.0-beta.9",
55
"type": "craft-plugin",
66
"minimum-stability": "dev",
77
"authors": [

src/Library/Composer/Components/AbstractField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ protected function validate(): array
691691
if (empty($value)) {
692692
$errors[] = $this->translate('This field is required');
693693
}
694-
} else if ('' === $value) {
694+
} else if (null === $value || '' === $value) {
695695
$errors[] = $this->translate('This field is required');
696696
}
697697
}

src/Library/Composer/Components/Fields/DynamicRecipientField.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ class DynamicRecipientField extends SelectField implements RecipientInterface, O
2424
/** @var bool */
2525
protected $showAsRadio;
2626

27+
/**
28+
* @return string
29+
*/
30+
public static function getFieldType(): string
31+
{
32+
return FieldInterface::TYPE_DYNAMIC_RECIPIENTS;
33+
}
34+
2735
/**
2836
* @return bool
2937
*/
@@ -88,8 +96,14 @@ public function getRecipients(): array
8896

8997
if (null !== $value && array_key_exists($value, $options)) {
9098
$option = $options[$value];
99+
$emails = explode(',', $option->getValue());
100+
101+
$batch = [];
102+
foreach ($emails as $email) {
103+
$batch[] = trim($email);
104+
}
91105

92-
return [$option->getLabel() => $option->getValue()];
106+
return $batch;
93107
}
94108

95109
return [];

src/codepack/templates/bootstrap/submissions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3>{{ form.name }}</h3>
4040
{% for submission in submissions %}
4141
<tr>
4242
<td>{{ submission.id }}</td>
43-
<td style="color: {{ submission.status }}">{{ submission.status.name }}</td>
43+
<td style="color: {{ submission.statusModel.color }}">{{ submission.statusModel.name }}</td>
4444
<td>
4545
<a href="{{ siteUrl }}demo/bootstrap/{{ form.handle }}/submissions/{{ submission.id }}">
4646
{{ submission.title }}

src/codepack/templates/bootstrap/view_submission.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h3>{{ form.name }} - {{ submission.title }}</h3>
4141
<table class="table table-striped">
4242
<tr>
4343
<th style="width: 20%;">Status</th>
44-
<td style="color: {{ submission.status }}">{{ submission.status.name }}</td>
44+
<td style="color: {{ submission.statusModel.color }}">{{ submission.statusModel.name }}</td>
4545
</tr>
4646
{% for field in submission.fieldMetadata %}
4747
<tr>

0 commit comments

Comments
 (0)