- Issue created by @dan_metille
- π§πͺBelgium svendecabooter Gent
Tested with OpenAI, and getting the following errors:
Warning: Undefined array key "fids" in Drupal\media_library\Form\FileUploadForm->validateUploadElement() (line 212 of /var/www/html/web/core/modules/media_library/src/Form/FileUploadForm.php)
ypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 212 of /var/www/html/web/core/modules/media_library/src/Form/FileUploadForm.php).
Haven't investigated the root cause yet...
- π§πͺBelgium svendecabooter Gent
EDIT: seems to be unrelated to this patch, because I'm getting the same errors when patch is not applied.
- πΊπΈUnited States CoffeyMachine
Hi @dan_metille, this is another good catch, thank you.
This is a use case I have not been able to properly test as I've only been able to work with a single provider so far. I tried setting up the Gemini and AWS Bedrock providers, but it appears both of those have their own issues with their text-to-image models. Are you able to share some details about what providers/models are you testing with? Maybe I can setup a similar environment.
For my future reference:
https://www.drupal.org/project/gemini_provider/issues/3466342 π Implement media in prompt Active
https://www.drupal.org/project/ai_provider_aws_bedrock/issues/3494009 π Malformed Input Request ActiveDespite this, I was able to test your UI AJAX changes. I see the form updating when I select different providers in the dropdown on
/media/add/image
. However, when I tested this in the Media Image field modal on a node, an AJAX error was thrown and the form did not update. We'll need this enhancement to work for both use cases.I'm also concerned about the special handling for specific providers/models. Why is this necessary? Code for specific providers/models is outside the scope of this module and needs to be handled by the provider modules.
It would be helpful to create an issue fork instead of sharing patch files. That way I may be able to collaborate on code changes.
- π°π¬Kyrgyzstan dan_metille
Thanks for the feedback @coffeymachine.
Let me first answer about the alternative provider that I have successfully tested: https://www.drupal.org/project/fireworksai β (Stable Diffusion, etc).
While I did not tried AWS Bedrock, I also had issues with Gemini, which is a pity because ImageFX is great.
Finally, I should admit that I forgot to test the patch while adding a Media Image on a node. Therefore, let me check that together with the special handling for specific providers/models and come back with an issue fork.