@@ -218,8 +218,8 @@ public function validateForm(array &$form, FormStateInterface $formState) {
218
218
$ formState ->setErrorByName ('endpoint ' , 'The endpoint path contains invalid characters. ' );
219
219
}
220
220
221
- /** @var \Drupal\graphql\Plugin\SchemaPluginInterface $instance */
222
221
$ schema = $ formState ->getValue ('schema ' );
222
+ /** @var \Drupal\graphql\Plugin\SchemaPluginInterface $instance */
223
223
$ instance = $ this ->schemaManager ->createInstance ($ schema );
224
224
if (!empty ($ form ['schema_configuration ' ][$ schema ]) && $ instance instanceof PluginFormInterface && $ instance instanceof ConfigurableInterface) {
225
225
$ state = SubformState::createForSubform ($ form ['schema_configuration ' ][$ schema ], $ form , $ formState );
@@ -233,8 +233,8 @@ public function validateForm(array &$form, FormStateInterface $formState) {
233
233
public function submitForm (array &$ form , FormStateInterface $ formState ) {
234
234
parent ::submitForm ($ form , $ formState );
235
235
236
- /** @var \Drupal\graphql\Plugin\SchemaPluginInterface $instance */
237
236
$ schema = $ formState ->getValue ('schema ' );
237
+ /** @var \Drupal\graphql\Plugin\SchemaPluginInterface $instance */
238
238
$ instance = $ this ->schemaManager ->createInstance ($ schema );
239
239
if ($ instance instanceof PluginFormInterface && $ instance instanceof ConfigurableInterface) {
240
240
$ state = SubformState::createForSubform ($ form ['schema_configuration ' ][$ schema ], $ form , $ formState );
@@ -248,13 +248,14 @@ public function submitForm(array &$form, FormStateInterface $formState) {
248
248
* @throws \Drupal\Component\Plugin\Exception\PluginException
249
249
*/
250
250
public function save (array $ form , FormStateInterface $ formState ) {
251
- parent ::save ($ form , $ formState );
251
+ $ save_result = parent ::save ($ form , $ formState );
252
252
253
253
$ this ->messenger ()->addMessage ($ this ->t ('Saved the %label server. ' , [
254
254
'%label ' => $ this ->entity ->label (),
255
255
]));
256
256
257
257
$ formState ->setRedirect ('entity.graphql_server.collection ' );
258
+ return $ save_result ;
258
259
}
259
260
260
261
}
0 commit comments