Closed simonerd closed 4 months ago
Ah that's no good, v4 should still be supported. I'll see if there's a fix that works in both.
Thanks for the detailed report!
Thanks for the detailed report!
Sure, happy to help. Thanks for the helpful chat at FlatCamp! 😉
Fixed in v0.7.1.
Bug Description
I'm using Distill in a search transformer for a bard field within a Statamic 4 site. The field has several sets (e. g. accordions, images with description etc.) and is plugged into Distill as described in the readme:
Unfortunately, this always results in an error "Call to a member function handle() on null", pointing to the
extractText
method (link to code). In L103 all items are mapped into theaugmentedValue
function which leads to loosing the fieldtype data that is required in L104 ($value->fieldtype()->handle()
), leading to the error.It looks like the changes introduced in 0.6.4 cause the error. When changing the first map (L103) back to
->map->value
(as it was before), the error disappears and the search transformer gets the correct data. Haven't looked into this more throughly, maybe the 0.6.4 changes are simply incompatible with v4.I'd probably be fine with simply fixing 0.6.3 for now until the site is updated to v5. However, if it really would be an incompatibility issue, the composer.json should be adjusted, I suppose.
How to Reproduce
v4 site, bard field with sets (haven't tested if sets are relevant), search transformer as described above.
Extra Detail
n/a
Environment