Skip to content
Snippets Groups Projects
Commit f8c6c8d4 authored by Martin Anderson-Clutz's avatar Martin Anderson-Clutz
Browse files

Issue #3399162 by hbdigit, mandclu: Error when generate variation (file_create_url)

parent 6ef79d12
No related branches found
No related tags found
No related merge requests found
Pipeline #174624 passed with warnings
......@@ -238,7 +238,7 @@ class openaiImagesVariations extends FormBase
$response->addCommand(new ReplaceCommand('#image-variation-preview-wrapper', $image_variation_wrapper));
// Enable the "Save Images" button.
// Enable the "Save Images" button.
$response->addCommand(new InvokeCommand('#edit-save-images', 'removeAttr', ['disabled']));
$response->addCommand(new InvokeCommand('#edit-save-images', 'removeClass', ['is-disabled']));
......@@ -257,7 +257,7 @@ class openaiImagesVariations extends FormBase
$api_key = $this->config('openai_images.settings')->get('api_key');
// Read the image file and convert it to content.
$file_url = \Drupal::service('file_url_generator')->generate($image_file)->toString();
$file_url = \Drupal::service('file_system')->realpath($image_file);
$image_data = file_get_contents($file_url);
// Prepare the form data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment