Skip to content

Commit

Permalink
Merge pull request #4620 from devinleighsmith/psp-9666
Browse files Browse the repository at this point in the history
HOTFIX psp-9666 hotfix: correct loading of partial property ids.
  • Loading branch information
devinleighsmith authored Jan 29, 2025
2 parents 17f66b7 + 88d046e commit d1d708f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,10 @@ describe('mapUtils tests', () => {
const cql = toCqlFilterValue({ PID: '12345678', PIN: '54321' }, { forceExactMatch: true });
expect(cql).toBe("PID = '12345678' AND PIN='54321'");
});

it('if property id is specified, exact search should always be used', () => {
const cql = toCqlFilterValue({ PROPERTY_ID: '1' });
expect(cql).toBe("PROPERTY_ID = '1'");
});
});
});
3 changes: 2 additions & 1 deletion source/frontend/src/hooks/layer-api/layerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export const toCqlFilterValue = (object: Record<string, string>, flags?: IWfsCql
} else if (
((key === 'PID' || key === 'PID_PADDED' || key === 'PID_NUMBER') &&
object[key]?.length === 9) ||
flags?.forceExactMatch
flags?.forceExactMatch ||
key === 'PROPERTY_ID'
) {
cql.push(`${key} = '${object[key]}'`);
} else {
Expand Down

0 comments on commit d1d708f

Please sign in to comment.