diff --git a/changelog/entries/unreleased/bug/fix_database_api_docs_toggle_crash.json b/changelog/entries/unreleased/bug/fix_database_api_docs_toggle_crash.json new file mode 100644 index 0000000000..c1f5f3ec2b --- /dev/null +++ b/changelog/entries/unreleased/bug/fix_database_api_docs_toggle_crash.json @@ -0,0 +1,9 @@ +{ + "type": "bug", + "message": "Fix the database API docs page crashing when opening the database list from the header.", + "issue_origin": "github", + "issue_number": 5212, + "domain": "database", + "bullet_points": [], + "created_at": "2026-04-16" +} diff --git a/changelog/entries/unreleased/bug/fix_database_filter_crash_for_null_select_values.json b/changelog/entries/unreleased/bug/fix_database_filter_crash_for_null_select_values.json new file mode 100644 index 0000000000..d7c9e1e394 --- /dev/null +++ b/changelog/entries/unreleased/bug/fix_database_filter_crash_for_null_select_values.json @@ -0,0 +1,9 @@ +{ + "type": "bug", + "message": "Fix database filters crashing when select option cells are temporarily null during row evaluation.", + "issue_origin": "github", + "issue_number": 5217, + "domain": "database", + "bullet_points": [], + "created_at": "2026-04-16" +} diff --git a/web-frontend/modules/database/arrayFilterMixins.js b/web-frontend/modules/database/arrayFilterMixins.js index 91e3593f1c..7e3678fe0d 100644 --- a/web-frontend/modules/database/arrayFilterMixins.js +++ b/web-frontend/modules/database/arrayFilterMixins.js @@ -260,13 +260,17 @@ export const baserowFormulaArrayTypeFilterMixin = { }, } +const getArrayFilterCellValue = (cellValue) => { + return Array.isArray(cellValue) ? cellValue : [] +} + export const hasSelectOptionIdEqualMixin = Object.assign( {}, hasValueEqualFilterMixin, { getHasValueEqualFilterFunction(field) { const mapOptionIdsToValues = (cellVal) => - cellVal.map((v) => ({ + getArrayFilterCellValue(cellVal).map((v) => ({ id: v.id, value: String(v.value?.id ?? ''), })) @@ -292,7 +296,10 @@ export const hasSelectOptionValueContainsFilterMixin = Object.assign( getHasValueContainsFilterFunction(field) { return (cellValue, filterValue) => genericHasValueContainsFilter( - cellValue.map((v) => ({ id: v.id, value: v.value?.value || '' })), + getArrayFilterCellValue(cellValue).map((v) => ({ + id: v.id, + value: v.value?.value || '', + })), filterValue ) }, @@ -306,7 +313,10 @@ export const hasSelectOptionValueContainsWordFilterMixin = Object.assign( getHasValueContainsWordFilterFunction(field) { return (cellValue, filterValue) => genericHasValueContainsWordFilter( - cellValue.map((v) => ({ id: v.id, value: v.value?.value || '' })), + getArrayFilterCellValue(cellValue).map((v) => ({ + id: v.id, + value: v.value?.value || '', + })), filterValue ) }, diff --git a/web-frontend/modules/database/pages/APIDocsDatabase.vue b/web-frontend/modules/database/pages/APIDocsDatabase.vue index 5b1ed562a9..8f448c3dc0 100644 --- a/web-frontend/modules/database/pages/APIDocsDatabase.vue +++ b/web-frontend/modules/database/pages/APIDocsDatabase.vue @@ -4,14 +4,17 @@ - {{ $t('apiDocsDatabase.pageTitle', database) }} - +
-
+