Commit c481610
(fix): convert associative arrays to Documents in relationship hooks
When inline relationship data is provided without $id (e.g.,
{'libraryName': 'Library 2'}), the Document constructor doesn't
auto-convert it since it lacks $id/$collection. The afterDocumentCreate
and afterDocumentUpdate hooks then see a plain array and throw
RelationshipException for OneToOne relationships.
Fix: convert non-list associative arrays to Documents before the
type-checking logic, allowing auto-ID generation to work.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 84c0c74 commit c481610
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
| |||
279 | 284 | | |
280 | 285 | | |
281 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
282 | 293 | | |
283 | 294 | | |
284 | 295 | | |
| |||
0 commit comments