Skip to content

Locations 0.5.2: Existing location folders join the media reorganizer

Locations 0.5.2 lets PhoenixKit’s mix phoenix_kit.media.reorganize tidy the files folders that locations and spaces already have, so older folders can follow the parent folder and names your app set up in 0.5.1.

The module now gives the reorganizer a plan. It moves existing location and space folders under the parent folder your :attachments_parent_folder hook returns, with the names from :attachments_folder_name, fills in missing folder links on records, and trashes empty upload folders left pending for more than seven days. It reports, without changing them, duplicates, copies found elsewhere, orphan folders and hooks that fail. A folder still named with the temporary pending name is given the proper name.

Without a parent folder hook the plan only reports and writes nothing. The task comes with PhoenixKit 2.24; on an older core nothing uses the plan.

Full release notes: Locations 0.5.2

0.5.2 · 16 September 2026

Added

  • Media reorganizer source (media_reorganizer/0 → PhoenixKitLocations.MediaReorganizer) for core 2.24’s mix phoenix_kit.media.reorganize. It plans moves of existing location and space folders under the host’s :attachments_parent_folder / :attachments_folder_name hooks, back-fills missing folder pointers, trashes stale empty pending upload folders, and reports duplicates, relocated copies, orphans and failing hooks. Without a configured parent hook it only reports.

Fixed

  • A folder pointer still carrying a location-attachment-pending-* name (a failed post-insert rename) is now renamed to the host name instead of keeping the pending name forever.
  • A record whose name hook fails no longer drops its resolved parent from the orphan-folder scan.
  • A "name (1)" folder is no longer read as a collision suffix of "name"; the rule now matches core’s (N >= 2).

Locations 0.5.2. Install or update: {:phoenix_kit_locations, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.