Skip to content

Catalogue 0.48.0: Media files sorted by catalogue, category and item

Catalogue 0.48.0 gives the PhoenixKit product catalogue a tidy place in the media library: each catalogue, category and item gets its own folder under Catalogues, and PDFs go to Catalogues/PDF.

A folder tree that follows the catalogue

Files are now filed as Catalogues/<catalogue>/<category…>/<item>. Folders use the record’s name in the site’s primary language; an item that shares its name with another in the same place gets its SKU added. A folder follows its record when it is renamed or moved, including the trash and restore paths that move items. A permanent delete frees the folder’s name for a new record.

If a folder cannot follow its record because every possible name is taken in the destination, it stays where it is. The delete or bulk trash that asked it to move still goes through.

A site that already set either of the two attachment folder hooks in its config keeps its own behaviour. To turn the new layout off, set both attachments_parent_folder and attachments_folder_name to nil.

Quality fixes

  • Text imports are read as UTF-8 or UTF-16, or refused with a message.
  • A broken XLSX file is reported as a parse error.
  • The export download now needs the catalogue permission, not just admin access.
  • Redirects from old addresses no longer fail with an error.
  • The shared sort is saved only when it actually changes.
  • Audit log rows record who made the change.

Upgrading

No migration. Update the dependency. New files go to the new folders right away. To move the folders created before this release, run mix phoenix_kit.media.reorganize --source catalogue.

Full release notes: Catalogue 0.48.0

0.48.0 · 13 October 2026

Reviews: dev_docs/pull_requests/2026/147-quality-sweep/, 148-media-folders/ (CLAUDE_REVIEW.md).

The requirements are unchanged.

Added

  • A default media folder layout: Catalogues/<catalogue>/<category…>/<item> with PDFs in Catalogues/PDF, installed as both attachment hooks by mix.exs. A record’s folder follows its renames and moves (including the trash and restore paths that move items), and a hard delete frees the folder’s name. A host that configured either hook keeps its old behaviour; set both keys to nil to turn the layout off. Folders that predate it are moved by mix phoenix_kit.media.reorganize --source catalogue. Thanks to timujinne (#148).

Fixed

  • A media folder that could not follow its record (every candidate name taken in the destination) no longer rolls back the permanent delete or bulk trash that asked it to follow; the folder stays where it is.
  • Quality sweep (#147): text imports are decoded from UTF-8/UTF-16 (or refused with a message), a malformed XLSX is a parse error, the export download needs the catalogue permission, old-address redirects never raise, the shared sort is written only when it changes, and audit rows carry their actor.
  • The test suite runs against phoenix_kit 2.62 (the locale segment is left out of an admin path on a single-language site).

Catalogue 0.48.0. Install or update: {:phoenix_kit_catalogue, "~> 0.48"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.