Closed johncarter- closed 2 years ago
This line:
ray($variation->product_size); // 🚨 null
outputs a LocalizedTerm
instance for me.
Are you sure there's a term named jum-8
?
If I adjust my product_size
value from jum-8
to definitely-doesnt-exist
... I get null
like you're showing.
Yeah it's there. I'll double check that I can get the LocalizedTerm
instance using the Term Facade in the morning, just to make sure it's working properly.
I've found another issue with taxonomy terms fields though, so it might be related. I'll let you know.
Yup it has to do with the field being the same name as the taxonomy.
If you rename your product_size
field to the_product_size
, it should work. (But obviously you shouldn't need to rename it)
This is the "taxonomizing" logic kicking in. But it shouldn't happen on nested fields (ie. inside a grid).
Bug description
It seems that a Term field inside a
Statamic\Fields\Values
object doesn't properly work with property access.The term has data as seen in the line retrieving the
raw()
product_size
.The other field types work: ✅ Text ✅ Toggle ✅ Integer ❌ Term
How to reproduce
Product blueprint (relevant section):
Product entry markdown
Logs
No response
Versions
Statamic 3.3.0-beta.6 Pro Laravel 8.83.4 PHP 8.1.1 spatie/statamic-responsive-images 2.9.1
Installation
Other (please explain)
Additional details
Can't remember how I installed it.