mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-29 13:36: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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStreet(string $street): self
|
public function setStreet(?string $street): self
|
||||||
{
|
{
|
||||||
|
if (null === $street) {
|
||||||
|
$street = '';
|
||||||
|
}
|
||||||
$this->street = $street;
|
$this->street = $street;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -515,8 +518,11 @@ class Address
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStreetNumber(string $streetNumber): self
|
public function setStreetNumber(?string $streetNumber): self
|
||||||
{
|
{
|
||||||
|
if (null === $streetNumber) {
|
||||||
|
$streetNumber = '';
|
||||||
|
}
|
||||||
$this->streetNumber = $streetNumber;
|
$this->streetNumber = $streetNumber;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -20,7 +20,13 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div hidden>
|
<div hidden>
|
||||||
|
{% if address.isNoAddress %}
|
||||||
|
{{ form_row(form.street, {'value': ' '})}}
|
||||||
|
{{ form_row(form.streetNumber, {'value': ' '})}}
|
||||||
|
{{ form_row(form.postCode)}}
|
||||||
|
{% else %}
|
||||||
{{ form_rest(form) }}
|
{{ form_rest(form) }}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user