Skip to content

Commit f8dd825

Browse files
author
Lung
committed
fixed birthDate null crash in edit form and documented uploadFile implicit coupling
1 parent df4dc90 commit f8dd825

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Event/AbstractContentArbiter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function __construct()
110110
placeholder: 'detail.birthPlacePlaceholder',
111111
);
112112
$this->uploadFile = new ContentArbiterItem(
113-
id: 'uploadFile',
113+
id: 'uploadFile', // not a real entity property; templates pass null explicitly, validation skips via required:false
114114
allowed: false,
115115
type: ContentArbiterItemType::File,
116116
order: 90,

src/Event/ContentArbiter/ContentArbiterItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class ContentArbiterItem
88
{
99
/**
10-
* @param array<string, string> $options key=dbValue, value=translationKey
10+
* @param array<string, string> $options key=dbValue, value=translationKey, backward compatibility for selfMappedOptions
1111
* @param list<string> $extraClasses
1212
*/
1313
public function __construct(

src/Participant/Participant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
use DateTimeInterface;
88
use kissj\Orm\EntityDatetime;
99
use kissj\Participant\Patrol\PatrolParticipant;
10-
use LeanMapper\Exception\MemberAccessException;
1110
use kissj\Deal\Deal;
1211
use kissj\Payment\Payment;
1312
use kissj\Payment\PaymentStatus;
1413
use kissj\User\User;
14+
use LeanMapper\Exception\MemberAccessException;
1515
use Ramsey\Uuid\Uuid;
1616

1717
/**

src/Templates/translatable/widgets/formFields.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
class="form-control{% if item.id != 'arrivalDate' and item.id != 'departureDate' %} form-wide{% endif %}"
4444
type="date"
4545
name="{{ item.id }}"
46-
value="{% if item.id == 'birthDate' %}{{ value.format('Y-m-d') ?? 'now - 18 years'|date('Y-m-d') }}{% elseif item.id == 'arrivalDate' %}{{ (value ?? event.startDay)|date('Y-m-d') }}{% elseif item.id == 'departureDate' %}{{ (value ?? event.endDay)|date('Y-m-d') }}{% else %}{{ value }}{% endif %}"
46+
value="{% if item.id == 'birthDate' %}{% if value %}{{ value.format('Y-m-d') }}{% else %}{{ 'now - 18 years'|date('Y-m-d') }}{% endif %}{% elseif item.id == 'arrivalDate' %}{{ (value ?? event.startDay)|date('Y-m-d') }}{% elseif item.id == 'departureDate' %}{{ (value ?? event.endDay)|date('Y-m-d') }}{% else %}{{ value }}{% endif %}"
4747
{% if item.required %}required="required"{% endif %}
4848
{% if item.id == 'birthDate' %}onchange="OnBirthDateChange(this)"{% endif %}
4949
>

0 commit comments

Comments
 (0)