Entities 0.4.13: Locked slugs on managed values, and faster bulk deletes
Entities 0.4.13 protects the slugs of records that another module, such as the catalogue, relies on. It also fixes a form that could refuse every save, and makes bulk deletes much lighter on open admin pages.
On an entity owned by another module, a record’s slug can no longer be renamed, its per-language slugs cannot change, and the record cannot be moved to another entity, except by the owning module itself. In the record form, the slug field is disabled with the note “Locked — the owning module keys on this slug”, and the generate button is hidden. In the entities list, such an entity shows “Managed by …”, with a link to the owning module’s admin when it names one, in place of archive and restore.
A multi-language save of such a record could be read as a slug rename and refused, locking the form for good. That is fixed. A bulk delete used to make every open data list and the Entities settings page reload once per deleted record; they now refresh once.
Full release notes: Entities 0.4.13
0.4.13 · 13 September 2026
Added
-
Slugs of a managed blueprint’s value records are locked on the write path (#44).
EntityData.update/3refuses a non-owner update with{:error, :locked_key}when it would:- rename a record’s
slug; - re-parent the record via
entity_uuid; - change a per-language
data[lang]["_slug"].
Owners pass
on_behalf_of: "<owner>". In the admin data form, the slug field is disabled on existing managed records and Generate is hidden (and gated server-side). - rename a record’s
-
The entities list shows “Managed by …” in place of Archive/Restore for a managed blueprint, with a link to the owner’s admin when
settings["managed_path"]is a safe local path (#44). -
EntityData.bulk_delete/2broadcasts:data_deletedfor every row it removes, matching the single-record delete, so owner subscribers can prune dangling slug references (#44). -
The test suite refuses to run against a live database (#45).
Test.LiveDatabaseGuardruns before any connection. It rejects a resolved name that does not end in_test(optionally followed by digits), and any name listed inPHOENIX_KIT_LIVE_DATABASES. -
Events.flush_data_events/0drops queued data lifecycle messages from the caller’s mailbox.
Fixed
- A multilang save of a managed value record no longer locks the form for
good. The multilang form injects the
slugcolumn’s value as the primary language’s_slugon every save. For a row stored without its own primary_slug(whatEntityData.create/2writes when onlyslugis set), the guard read that value as a rename and refused every save. - A bulk delete no longer triggers one full reload per deleted row in every open data list and Entities Settings page. Both handlers now collapse queued data events into a single refresh.
LiveDataFormandMirror.Importerno longer treat a non-changeset error fromEntityData.update/3as a changeset (#44).
Changed
- Documentation: the migration moduledoc states the core
V169floor (first released inphoenix_kit2.4.0), andmix.exsexplains why the pin stays~> 2.0(#46). The README now cites core’sV135baseline instead of the pre-squashV17… history. - Tests pin every adopted index and constraint name, and cover
migrated_version_runtime/1against real table comments (#46).
Entities 0.4.13. Install or update: {:phoenix_kit_entities, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.