Skip to content

Commit b6ee968

Browse files
jensensclaude
andauthored
fix: ValueError on empty path query — filter like ZCatalog does (#97)
lineage.index passes path='' which ZCatalog silently ignores. Now filters empty/blank paths before validation. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6afb1ea commit b6ee968

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.0.0b47
4+
5+
### Fixed
6+
7+
- Fix `ValueError: Invalid path: ''` when path query receives empty
8+
string. Empty/blank paths are now silently filtered, matching
9+
ZCatalog behavior.
10+
311
## 1.0.0b46
412

513
### Fixed

src/plone/pgcatalog/query.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ def _handle_path(self, name, idx_key, spec):
483483
navtree_start = spec.get("navtree_start", 0)
484484

485485
paths = [query_val] if isinstance(query_val, str) else list(query_val)
486+
# Filter empty/blank paths — ZCatalog silently ignores them
487+
paths = [p for p in paths if p and p.strip()]
488+
if not paths:
489+
return # nothing to query
486490

487491
if len(paths) > _MAX_PATHS:
488492
raise ValueError("Too many paths in query")

0 commit comments

Comments
 (0)