- Status changed to Fixed
12 months ago 4:49pm 28 December 2023 - πΊπΈUnited States kevinquillen
This is fixed via π Getting an error on chapgpt configure page. Fixed .
Automatically closed - issue fixed for 2 weeks with no activity.
If you enable openai and openai_ckeditor, and add the OpenAI plugin to CKEditor before configuring the API key for OpenAI, you will encounter an error.
Update the CKEditor plugin to check that the API Key exists. Add either a check like this in the top of
public function buildConfigurationForm(array $form, FormStateInterface $form_state)
method.
$config = \Drupal::configFactory()->getEditable('openai.settings');
if (!$config->get('api_key')) {
$form['completion'] = [
'#markup' => '<p>' . $this->t('Please configure OpenAI API Settings first <a href="/admin/config/openai/settings">here</a>.') . '</p>',
];
return $form;
}
Alternatively, consider adding a dedicated function to the OpenAIApi service, such as function isConfigured()
. So we can can call $this->api->isConfigured()
, that can serve as a convenient check to ensure that the API is properly configured before making calls, providing a streamlined way to validate the configuration status before initiating operations, such as listing models or displaying the CKEditor settings form.
Fixed
1.0
OpenAI CKEditor
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This is fixed via π Getting an error on chapgpt configure page. Fixed .
Automatically closed - issue fixed for 2 weeks with no activity.