- Issue created by @keiserjb
- πΊπΈUnited States keiserjb
Turns out the javascript wasn't the problem at all.
In 1.1.x, the AiCKEditorPluginBase::buildCkEditorModalForm() method was refactored to add new structure (response_wrapper, generate_actions, etc.) and handle more logic internally. This breaks any contrib plugins (like ai_summarize_document) that were written against the 1.0.x structure and manually added response_text, selected_text, or actions['generate'].
public function buildCkEditorModalForm(array $form, FormStateInterface $form_state, array $settings = []) { $form = parent::buildCkEditorModalForm($form, $form_state); $form['document'] = [ '#type' => 'entity_autocomplete', '#target_type' => 'media', '#title' => t('Document'), '#required' => TRUE, '#selection_settings' => [ 'target_bundles' => [$this->configuration['document_bundle']], ], ]; $form['tone'] = [ '#type' => 'select', '#title' => $this->t('Choose the tone'), '#required' => FALSE, '#empty_option' => $this->t('- None -'), '#description' => $this->t('Selecting one of the options will adjust/reword the body content to be appropriate for the target audience.'), '#access' => !empty($this->configuration['tone_vocabulary']), ]; $form['tone']['#options'] = $this->getTermOptions($this->configuration['tone_vocabulary']); $form['length'] = [ '#type' => 'select', '#title' => $this->t('Choose the length of the response'), '#required' => FALSE, '#empty_option' => $this->t('- None -'), '#description' => $this->t('Selecting one of the options will limit the length of the response text.'), '#access' => !empty($this->configuration['length_vocabulary']), ]; $form['length']['#options'] = $this->getTermOptions($this->configuration['length_vocabulary']); // Remove the selected text field since we don't need it unset($form['selected_text']); return $form; } /** * {@inheritdoc} */ protected function needsSelectedText() { return FALSE; }
- Merge request !2Draft: Resolve #3523992 "Aickeditorpluginbase modal structure" β (Closed) created by keiserjb