Skip to content

Entities 0.4.14: Image and video fields can upload into a folder you choose

Entities 0.4.14 lets a site decide which media folder the image and video fields of a record use. The media picker then browses and uploads only inside that folder.

The folder comes from a function your app names in its configuration:

config :phoenix_kit_entities, :attachments_parent_folder, {MyApp.Media, :parent_for}

It is called with :entity_file, the acting user’s id and the entity’s name. The function runs when the picker opens, not when the form loads, so a function that creates folders never writes anything on a plain page view. If it raises, the picker opens without a folder limit. Without this setting, nothing changes.

Full release notes: Entities 0.4.14

0.4.14 · 15 September 2026

Added

  • Entity image/video fields can pick and upload into a host-configured folder (#47). config :phoenix_kit_entities, :attachments_parent_folder, {Mod, :fun}, called as fun(:entity_file, actor_uuid, %{entity_name: name}) (or fun(:entity_file, actor_uuid)), scopes the data form’s media picker to that folder — both browsing and new uploads — via the existing scope_folder_id support in core’s MediaSelectorModal. The hook runs when the picker opens, not when the form renders, so a host hook that find-or-creates folders never writes on a page view; a raising or exiting hook leaves the picker unscoped. Without a hook configured, behaviour is unchanged.

Changed

  • Dependency lock: phoenix_kit 2.23.2, phoenix 1.8.14, tz 0.28.4.

Entities 0.4.14. Install or update: {:phoenix_kit_entities, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.