diff --git a/backend/src/baserow/contrib/integrations/local_baserow/service_types.py b/backend/src/baserow/contrib/integrations/local_baserow/service_types.py index fa149c036d..d3d1aef37b 100644 --- a/backend/src/baserow/contrib/integrations/local_baserow/service_types.py +++ b/backend/src/baserow/contrib/integrations/local_baserow/service_types.py @@ -2373,11 +2373,13 @@ def import_path(self, path, id_mapping): Import Local Baserow signal service types paths. """ - # All Local Baserow signal service types have a length of 3: - # {previousNodeId}.{rowIndex}.{fieldName}. By this point, we should - # only have two parts: {rowIndex}.{fieldName}. - if len(path) == 2: - index, field_dbname = path + # If we receive: + # {previousNodeId}.{rowIndex}.{fieldName}, or + # {previousNodeId}.{rowIndex}.{fieldName}.{fieldValueIndex}.{value} + # (e.g. a `link_row`) + # then pluck out the row index / field name and use it. + if len(path) >= 2: + index, field_dbname, *rest = path else: # In any other scenario, we have a formula that is not a format we # can currently import properly, so we return the path as is. @@ -2392,7 +2394,7 @@ def import_path(self, path, id_mapping): self.import_property_name(field_dbname, id_mapping) or field_dbname ) - return [index, imported_field_dbname] + return [index, imported_field_dbname, *rest] class LocalBaserowRowsCreatedServiceType(LocalBaserowRowsSignalServiceType): diff --git a/backend/tests/baserow/contrib/integrations/local_baserow/service_types/test_rows_signal_service_type.py b/backend/tests/baserow/contrib/integrations/local_baserow/service_types/test_rows_signal_service_type.py new file mode 100644 index 0000000000..93fbd8f7a2 --- /dev/null +++ b/backend/tests/baserow/contrib/integrations/local_baserow/service_types/test_rows_signal_service_type.py @@ -0,0 +1,34 @@ +import pytest + +from baserow.contrib.integrations.local_baserow.service_types import ( + LocalBaserowRowsCreatedServiceType, +) + + +@pytest.mark.parametrize( + "path,id_mapping,expected", + [ + # When path has fewer than 2 elements, return as is + ([], {}, []), + (["0"], {}, ["0"]), + # When field_dbname doesn't start with "field_", return path as is + (["0", "id"], {}, ["0", "id"]), + (["0", "foo"], {}, ["0", "foo"]), + # {rowIndex}.{fieldName} and field not in mapping + (["0", "field_1"], {}, ["0", "field_1"]), + # {rowIndex}.{fieldName} and field in mapping + (["0", "field_1"], {"database_fields": {1: 2}}, ["0", "field_2"]), + # {rowIndex}.{fieldName}.{fieldValueIndex}.{value} and field not in mapping + (["0", "field_1", "0", "value"], {}, ["0", "field_1", "0", "value"]), + # {rowIndex}.{fieldName}.{fieldValueIndex}.{value} and field in mapping + ( + ["0", "field_1", "0", "value"], + {"database_fields": {1: 2}}, + ["0", "field_2", "0", "value"], + ), + ], +) +def test_local_baserow_rows_signal_service_type_import_path(path, id_mapping, expected): + assert ( + LocalBaserowRowsCreatedServiceType().import_path(path, id_mapping) == expected + ) diff --git a/changelog/entries/unreleased/bug/resolved_a_bug_which_prevented_certain_baserow_field_types_f.json b/changelog/entries/unreleased/bug/resolved_a_bug_which_prevented_certain_baserow_field_types_f.json new file mode 100644 index 0000000000..a25b4d235d --- /dev/null +++ b/changelog/entries/unreleased/bug/resolved_a_bug_which_prevented_certain_baserow_field_types_f.json @@ -0,0 +1,9 @@ +{ + "type": "bug", + "message": "Resolved a bug which prevented certain Baserow field types from being used after a row-change trigger.", + "issue_origin": "github", + "issue_number": null, + "domain": "automation", + "bullet_points": [], + "created_at": "2026-03-20" +} \ No newline at end of file