Skip to content
Snippets Groups Projects
Commit c2ba47ac authored by dubs's avatar dubs Committed by john.oltman
Browse files

Issue #3334521 by Dubs: Allow 0 (unlimited) to be set on Maximum number of spaces allowed.

parent 2d8b5293
No related branches found
No related tags found
No related merge requests found
......@@ -15,3 +15,14 @@ function registration_update_9001() {
$workflow->save();
}
}
/**
* Changes the maximum spaces setting to allow zero (unlimited) value.
*/
function registration_update_9002() {
$entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
if ($field_definition = $entity_definition_update_manager->getFieldStorageDefinition('maximum_spaces', 'registration_settings')) {
$field_definition->setSetting('min', 0);
$entity_definition_update_manager->updateFieldStorageDefinition($field_definition);
}
}
......@@ -248,7 +248,7 @@ class RegistrationSettings extends ContentEntityBase implements HostEntityKeysIn
->setLabel(t('Spaces allowed'))
->setDescription(t('The maximum number of spaces allowed for each registrations. For no limit, use 0. (Default is 1)'))
->setRequired(TRUE)
->setSetting('min', 1)
->setSetting('min', 0)
->setSetting('max', 99999)
->setDisplayOptions('form', [
'type' => 'number',
......
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