Skip to content
Snippets Groups Projects
Commit 6098f176 authored by Owen Bush's avatar Owen Bush
Browse files

Fix issue with editing an old registrant and form fields being hidden

parent 1028c30d
No related branches found
No related tags found
No related merge requests found
......@@ -301,6 +301,10 @@ class RegistrantForm extends ContentEntityForm {
* The form state interface.
*/
protected function hideFormFields(array &$form, FormStateInterface $form_state) {
/* @var $entity \Drupal\recurring_events_registration\Entity\Registrant */
$entity = $this->entity;
$new = $entity->isNew();
$form_fields = $this->fieldManager->getFieldDefinitions('registrant', $this->entity->getBundle());
$availability = $this->creationService->retrieveAvailability();
......@@ -311,7 +315,7 @@ class RegistrantForm extends ContentEntityForm {
// no spaces left, and no waitlist.
if (($availability === 0 && !$waitlist) || !$registration_open) {
foreach ($form_fields as $field_name => $field) {
if (isset($form[$field_name])) {
if (isset($form[$field_name]) && $new) {
$form[$field_name]['#printed'] = TRUE;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment