mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-29 05:26:13 +00:00
address: handle cases when null street and streetnumber are given
This commit is contained in:
parent
ddce7603ad
commit
017b7bca87
@ -480,8 +480,11 @@ class Address
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setStreet(string $street): self
|
||||
public function setStreet(?string $street): self
|
||||
{
|
||||
if (null === $street) {
|
||||
$street = '';
|
||||
}
|
||||
$this->street = $street;
|
||||
|
||||
return $this;
|
||||
@ -515,8 +518,11 @@ class Address
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setStreetNumber(string $streetNumber): self
|
||||
public function setStreetNumber(?string $streetNumber): self
|
||||
{
|
||||
if (null === $streetNumber) {
|
||||
$streetNumber = '';
|
||||
}
|
||||
$this->streetNumber = $streetNumber;
|
||||
|
||||
return $this;
|
||||
|
@ -20,7 +20,13 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div hidden>
|
||||
{{ form_rest(form) }}
|
||||
{% if address.isNoAddress %}
|
||||
{{ form_row(form.street, {'value': ' '})}}
|
||||
{{ form_row(form.streetNumber, {'value': ' '})}}
|
||||
{{ form_row(form.postCode)}}
|
||||
{% else %}
|
||||
{{ form_rest(form) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
|
Loading…
x
Reference in New Issue
Block a user