Staff 0.9.0: Safer avatars, edit forms in your language and a header trail
Staff 0.9.0 moves the PhoenixKit staff directory onto core’s shared toolkits, closes a hole that let an avatar point at any stored file, and makes edit forms open in the language you are viewing.
Avatars only from the person’s own images
The Images tab’s “set as avatar” action sent a file id from the browser, so a forged request could set a person’s avatar to any file in storage. An avatar now has to be a live image in that person’s own Images folder. Setting, clearing or removing an avatar also no longer overwrites other data saved on the person in the meantime, such as the status kept for a trashed person, and removing an image no longer clears an avatar another admin has just set.
Trashing and restoring a person read and write the stashed status in the row itself, so two admins trashing the same person at once no longer both succeed: the second is refused.
Forms and page headers
Edit forms for departments, teams, skills and people now open on the language the page is viewed in. New-record forms still open on the main language. Every staff page shows the standard admin header trail (Staff, the list, the record), and a team page shows its department as a link instead of in the header.
Upgrading
Staff 0.9 needs PhoenixKit core 2.38 or later, below 3.0: activity logging, person media folders and the media reorganizer now go through core’s shared code. No migration. If your own code calls Attachments.set_avatar/3 or Attachments.clear_avatar/2, they now take the acting user and the file id to clear.
Full release notes: Staff 0.9.0
0.9.0 · 26 September 2026
Changed
- Requires
phoenix_kit>= 2.38.0 and < 3.0.0. The module now runs on core’s shared toolkits: activity logging goes throughPhoenixKit.Activity.log/3and the actor throughPhoenixKitWeb.Actor(the scope first, then the current user); person media folders, attach/detach, listing and purge go throughStorage.ResourceFolders; the media reorganizer is aReorganizer.ResourceSourcespec (it never proposes host folder names); file icons and sizes come fromUtils.Format. - Edit forms open on the language the page is viewed in; new-record forms still open on the main language.
- Every staff page shows the standard admin header trail (Staff / list / record). A team’s department is shown as a link on the team page instead of as the header section.
Attachments.set_avatar/3takes the acting user, andAttachments.clear_avatar/2takes the file uuid to clear.
Fixed
- A person’s avatar only accepts a live image in that person’s own
Imagesfolder. The media tab’s “set as avatar” sends a client-side uuid, which could point the avatar at any file in storage. - Setting or clearing the avatar writes only the avatar key, under the file’s row lock, and re-checks the person was not trashed meanwhile. It no longer replaces the metadata map from a stale struct, which dropped keys written since (such as
trashed_from_status). - Removing an image no longer clears an avatar another session set since; the header refreshes only when the avatar actually changed.
- Trash and restore read and write the stashed status in the row itself, so a key written in between survives, and two sessions trashing at once get one success and one
:already_trashed. Both still bumpupdated_at, like their bulk variants. - The person form ignores a
metadataparam, and the person changeset keepsavatar_uuidandtrashed_from_statusas the row holds them whatever metadata map it is given. - A failed avatar set is logged as
staff.person_avatar_seton the failure side.
Staff 0.9.0. Install or update: {:phoenix_kit_staff, "~> 0.9"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.