mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Merge branch 'fix/center-type-show-hidden-when-no-center-reachable' into 'master'
[CenterType] switch to hidden type with null value when no center is reachable See merge request Chill-Projet/chill-bundles!162
This commit is contained in:
commit
9450d34af0
@ -12,6 +12,8 @@ and this project adheres to
|
|||||||
|
|
||||||
* [Household editor][UI] Update how household suggestion and addresses are picked;
|
* [Household editor][UI] Update how household suggestion and addresses are picked;
|
||||||
* [AddAddress] Handle address suggestion;
|
* [AddAddress] Handle address suggestion;
|
||||||
|
* [CenterType][Create a person] when overriding the ACL rules, allow to show a PickCenterType
|
||||||
|
when no centers are reachable by the default ACL.
|
||||||
* [Household] Show comment event if no address are associated with the household;
|
* [Household] Show comment event if no address are associated with the household;
|
||||||
* [Person results] Add requestor into search results:
|
* [Person results] Add requestor into search results:
|
||||||
|
|
||||||
|
@ -76,10 +76,7 @@ class CenterType extends AbstractType
|
|||||||
{
|
{
|
||||||
$nbReachableCenters = count($this->reachableCenters);
|
$nbReachableCenters = count($this->reachableCenters);
|
||||||
|
|
||||||
if ($nbReachableCenters === 0) {
|
if ($nbReachableCenters <= 1) {
|
||||||
throw new \RuntimeException("The user is not associated with "
|
|
||||||
. "any center. Associate user with a center");
|
|
||||||
} elseif ($nbReachableCenters === 1) {
|
|
||||||
return HiddenType::class;
|
return HiddenType::class;
|
||||||
} else {
|
} else {
|
||||||
return EntityType::class;
|
return EntityType::class;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user