AI-generated images ignore Media Image field "File Directory" setting

Created on 3 May 2025, 6 days ago

Problem/Motivation

Hi and thanks for this great module!

I noticed that when generating images using the AI Media Image module, the files are always saved directly to the root public:// directory, instead of using the "File Directory" setting configured on the Media Image field (including any tokens like [date:custom:Y]-[date:custom:m]).

This makes it hard to keep files organized, especially on larger sites.

Proposed resolution

I've attached a patch that updates the module to respect the configured file directory for the Media Image field, just like standard uploads. The fix retrieves the field's directory setting, processes tokens, and ensures the image is saved in the correct subfolder.

Thanks for considering this improvement, and let me know if you need any adjustments!

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇰🇬Kyrgyzstan dan_metille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024