File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 2525use Drupal \Core \Form \FormStateInterface ;
2626use Drupal \json_forms \Form \Util \FieldNameUtil ;
2727use Drupal \json_forms \Form \Util \FormCallbackExecutor ;
28+ use Drupal \json_forms \Form \Util \FormCallbackRegistrator ;
2829use Drupal \json_forms \Form \Util \FormValidationUtil ;
2930use Drupal \json_forms \Form \Validation \FormValidationMapperInterface ;
3031use Drupal \json_forms \Form \Validation \FormValidatorInterface ;
@@ -122,6 +123,7 @@ protected function buildJsonFormsForm(
122123
123124 if ($ formState ->isRebuilding ()) {
124125 $ formState ->set ('$hasCalcInitField ' , FALSE );
126+ FormCallbackRegistrator::clearPreSchemaValidationCallbacks ($ formState );
125127 }
126128
127129 $ definition = DefinitionFactory::createDefinition ($ uiSchema , $ jsonSchema );
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ final class FormCallbackRegistrator {
2626
2727 public const PRE_SCHEMA_VALIDATION_CALLBACKS_PROPERTY_KEY = 'json_forms.pre_schema_validation_callbacks ' ;
2828
29+ public static function clearPreSchemaValidationCallbacks (FormStateInterface $ formState ): void {
30+ $ formState ->set (self ::PRE_SCHEMA_VALIDATION_CALLBACKS_PROPERTY_KEY , []);
31+ }
32+
2933 /**
3034 * Registers a callback that is executed before JSON schema validation.
3135 *
You can’t perform that action at this time.
0 commit comments