I've been using globals many times but this is my first time encounter with such problem. Let's go from the bottom. I have two global sets with handles tax
and company
. The Tax set have only one plain text field taxRate
which can be accessed like documentation says {{ tax.taxRate }}
.
The Company set have more plain text fields and one table field.
Odd thing happens when I try to access any plain text field the same way. Example: {{ company.businessName }}
.
I've tried to see what I get outputted using dump() function of that field and the output is quiet broader than the dump output of {{ tax.taxRate }}
.
{{ dump(tax.taxRate) }}` -> string(2) "20"
{{ dump(company.businessName) }}` -> object(Craft\ElementCriteriaModel)#942 (17) {
["strictAttributes":protected]=>
bool(false)
["_elementType":"Craft\ElementCriteriaModel":private]=>
object(Craft\EntryElementType)#372 (7) {
["componentType":protected]=>
string(11) "ElementType"
["_sourcesByContext":"Craft\BaseElementType":private]=>
NULL
["_classHandle":"Craft\BaseComponentType":private]=>
NULL ... and another dozens lines of it
I can access it using craft.globals.getSetByHandle('company')
but I don't understand why I'm getting object returned in the set Company and string returned in the set Tax using the same fetch approach?