Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ All notable changes to the Super Layout Table Extension will be documented in th
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.1] - 2026-05-09
## [0.3.2] - 2026-05-09

### Fixed
- **Inline editing silently failing for collections with non-`id` primary key
(Issue #44).** `handleUpdate` and `handleBooleanToggle` in
`EditableCellRelational.vue` were detecting the primary key by name pattern
matching (`key === 'id' || key.endsWith('_id')`), which produced no result on
collections whose primary key uses a different name (`code`, `slug`, `uuid`,
`sku`, …). Both functions now read the primary key field name from the
`primaryKeyField` computed property, which is sourced from the Directus
schema via the parent component. The previous heuristic could also have
selected an unrelated foreign-key column ending in `_id` and dispatched the
PATCH against the wrong record; that misdirection is no longer possible.



### Changed
- Bumped 21 development dependencies to their latest patch versions within
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "directus-extension-super-table",
"version": "0.3.1",
"version": "0.3.2",
"description": "A powerful and feature-rich table layout extension for Directus 11+ with inline editing, quick filters, and manual sorting",
"keywords": [
"directus",
Expand Down
16 changes: 8 additions & 8 deletions src/components/EditableCellRelational.vue
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,13 @@ function renderTemplate(value: any, template: string): string {
}

function handleUpdate(value: any) {
const primaryKey = Object.keys(props.item).find((key) => key === 'id' || key.endsWith('_id'));
const itemId = props.item?.[primaryKeyField.value];

if (primaryKey) {
if (itemId !== undefined && itemId !== null) {
// Check if this is a full translations update
if (typeof value === 'object' && value?.isFullTranslations) {
// Handle full translations update from interface-translations
emit('update', props.item[primaryKey], 'translations', {
emit('update', itemId, 'translations', {
isFullTranslations: true,
translations: value.translations,
});
Expand All @@ -631,17 +631,17 @@ function handleUpdate(value: any) {
language: fieldLanguage.value, // Use language from field key or selected
isTranslation: true,
};
emit('update', props.item[primaryKey], props.fieldKey, translationUpdate);
emit('update', itemId, props.fieldKey, translationUpdate);
} else {
emit('update', props.item[primaryKey], props.fieldKey, value);
emit('update', itemId, props.fieldKey, value);
}
}
}

function handleBooleanToggle(value: boolean) {
const primaryKey = Object.keys(props.item).find((key) => key === 'id' || key.endsWith('_id'));
if (primaryKey) {
emit('update', props.item[primaryKey], props.fieldKey, value);
const itemId = props.item?.[primaryKeyField.value];
if (itemId !== undefined && itemId !== null) {
emit('update', itemId, props.fieldKey, value);
}
}

Expand Down
Loading