src/Form/JsonApiSettingsForm.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Form/JsonApiSettingsForm.php b/src/Form/JsonApiSettingsForm.php index ded0f12..6f720e7 100644 --- a/src/Form/JsonApiSettingsForm.php +++ b/src/Form/JsonApiSettingsForm.php @@ -37,8 +37,8 @@ class JsonApiSettingsForm extends ConfigFormBase { '#title' => $this->t('Enable read-only mode'), '#title_display' => 'invisible', '#options' => [ - 'r' => $this->t('Allow only reading'), - 'rw' => $this->t('Allow reading and writing'), + 'r' => $this->t('Allow only reading.'), + 'rw' => $this->t('Allow reading and writing.'), ], '#default_value' => $jsonapi_config->get('read_only') === TRUE ? 'r' : 'rw', '#description' => $this->t('When writing is allowed, entities (content items, taxonomy terms, …) can be added, changed, or removed via JSON:API. This may have security implications.', [':docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/security-considerations']), @@ -52,7 +52,7 @@ class JsonApiSettingsForm extends ConfigFormBase { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->config('jsonapi.settings') - ->set('read_only', $form_state->getValue('read_only')) + ->set('read_only', $form_state->getValue('read_only') === 'r') ->save(); parent::submitForm($form, $form_state);