You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.
Context: When displaying an event registration form (in our case using rng_quick and rng_contact) the default form display with the many options is much too complicated and it would be good and enough to display the registrant form with its field directly / initially.
I tried to solve this using a custom module and found out that "show_entity_create_form" controls that. See:
<?php
/**
* Get form state for opening the create-an-entity sub-form.
*
* @return boolean
* Wther the create-an-entity sub-form is open.
*/
public function getShowCreateEntitySubform() {
return (bool) $this->formState->get(array_merge($this->element['#parents'], ['show_entity_create_form']));
}
/**
* Set form state for opening the create-an-entity sub-form.
*
* @param $value
*/
public function setShowCreateEntitySubform($value) {
$this->formState->set(array_merge($this->element['#parents'], ['show_entity_create_form']), $value);
}
?>
$entity_create_form = $utility->getShowCreateEntitySubform(); checks for that in src/Element/Registrants.php but the function always returns FALSE in the current implementation if the toggle button is not clicked.
It would be very helpful to have an option or open the form by default if the arity is single and there is only one type of registration allowed. This makes a lot of sense I think and would be cool for UX! :)
The text was updated successfully, but these errors were encountered:
Context: When displaying an event registration form (in our case using rng_quick and rng_contact) the default form display with the many options is much too complicated and it would be good and enough to display the registrant form with its field directly / initially.
I tried to solve this using a custom module and found out that "show_entity_create_form" controls that. See:
(http://cgit.drupalcode.org/rng/tree/src/RegistrantsElementUtility.php?h=8.x-1.x)
$entity_create_form = $utility->getShowCreateEntitySubform();
checks for that in src/Element/Registrants.php but the function always returns FALSE in the current implementation if the toggle button is not clicked.It would be very helpful to have an option or open the form by default if the arity is single and there is only one type of registration allowed. This makes a lot of sense I think and would be cool for UX! :)
The text was updated successfully, but these errors were encountered: